Wappler Creates Duplicate $_POST Variables

(I know I have reported this before - but I can’t seem to find the original post any more!)

@George, you asked if I could work out how to re-create this issue where duplicate $_POST variables are created. I just worked out how to do that!

Imagine you have a database table called contacts with fields name and email.

  1. Create a Server Action.
  2. Add POST variables name and email
  3. Add an Insert Database step, select the contacts table. Wappler automatically lists the fields and ‘values’ = $_POST.name, $_POST.email.
  4. Click on Okay
  5. You will now have two post variables for name and email!

What if you select these using the picker, are they created then as well?

Probably not, but I’ve not tried it.

But of course it would feel strange to pick something again that is already there…

@Teodor Wappler has also been creating duplicate $GET for me, to add to this post. So I have to keep going in and editing the SC file manually.

@mgaussie
If you have the exact steps to reproduce this, please share them so we can check what’s wrong.

1 Like

The “problem” is that insert and update server actions create their own $_POST variables regardless if these values are already there.

My workflow is to create the server actions and let Wappler do its job.

The delete server action does not automatically create a $_POST variable

I have seen this happen with Get and Post both, but unfortunately haven’t been able to reliably reproduce it.

Only way to fix it is to open it in editor, and remove duplicate from JSON.
UI does not allow selecting the the duplicate entry thats second in list.

1 Like

There is another issue in this area which happens occasionally, and just happened to me two minutes ago. You can go through a series of button clicks and make the $_GET input area disappear completely!

I honestly didn’t do this by editing PHP, it was completely done by Wappler. If I can reproduce it, I’ll post the steps here!

no_brand

Antony, please post different issues in different topics. This topic is about $_POST vars being duplicated.
Also - posts saying “something broke and i don’t know how” are not really useful.

Thanks for your reply Teodor.

I posted it here as I believe it is related to the same bug and I feel the information I have provided could be useful when the bug is being researched and fixed!

This occurs alongside the duplication bug after the Action is saved. If you then go back to the Action and remove the duplicates it more often than not also removes the post/get Inputs all together… That is our experience. More often than not the duplicate variables are not able to be selected in this circumstance so if you then select the original variable that is actually selectable and delete it what Antony mentions is instigated (all inputs vanish from the Action). I’m sure I documented this a fair while back…

Well it looks like you found a good edge case @Antony :slight_smile:

This happened indeed when you were just created the $_POST variables fresh and also after each other from the context menu. They weren’t made unique then.

Anyway it will be solved in the next update. So you can have all variables created as you wish - and the creation order won’t matter @ben

2 Likes

Thank you @George! :slight_smile:

I appreciate you folks taking the time to follow this one through and get to the bottom of it!

2 Likes

Fixed in Wappler 3.7.3

This topic was automatically closed after 43 hours. New replies are no longer allowed.