Can't remove duplicated POST variable

Wappler Version : 5.2.3
Operating System : Linux
Server Model: Node
Database Type: mysql
Hosting Type: docker

Expected behavior

Deleting 1 post variable should delete that variable

Actual behavior

IT deletes all post variables, and renders the server action unable to be saved

How to reproduce

I get this more often, but haven’t seen the pattern yet WHEN this exactly happens.

This is what is going wrong:

  1. Note that the ‘slug’ variable is in there twice
  2. I try to remove the slug variable
  3. It removes the entire $_POST group
  4. It doesn’t actually give me a ‘unsaved changes circle’ and pressing CTRL+S, then re-opening the server action shows that it didn’t save

EDIT:

  1. I do see ‘slug’ twice in the .json file
  2. I did NOT have it linked to a form before this happened. I did that later and don’t think it has anything to do with this issue.
  3. Manually removing it from the .json file works fine

Let’s start with this - how did you manage to get the same POST variable added twice?

Sorry I can’t remember how it happened. I do know it happens more often.

And I do remember it happened by an automatic Wappler action.
I for sure added it manually first, and perhaps it has been added automatically by a ‘database update’ action.

If you need more info first then perhaps someone else can chime in, or I’ll update this post when it happens again

Yes, we need to know how did this POST var get added twice, as it should not happen. So please keep an eye for this and let us know the exact steps when this happens.

1 Like

Okay, got it. This is what I just did to create 2 post vars:

  1. Create ‘database update’ step
  2. Leave ‘condition’ as is, save
  3. You now have a var $_POST.id
  4. Manually rename that var to $_POST.faq_id
  5. Go back into the database update, change the post var without using the formatter to $POST.faq_id:
  6. Now I have 2 vars with hte same name: image

Note: in this particular case, I can delete one of the faq_id’s without any problem.

it always used to happen for me in v3.9.7 when I had already added the post variable manually, and I then created a database action step (e.g, insert). Creating that step adds post variables with the same name as the database field by default… and if the post variable already existed, it would be created again, eg duplicated.

Could this bug have come back in some way?

Antony, we are on version 5 already and this v3 issue has been fixed like ages ago.

@karh thanks for the steps to reproduce it, this will be improved in this week’s update.

1 Like

Fixed in Wappler 5.2.4

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