0

Magento 1.7

In the Admin Panel under System-->Permissions-->Users

When I click on a User OR "Add New User" and I right click and inspect element I see the following for both: enter image description here

They both share the same Action Url which doesn't make sense shouldn't me clicking on a User have a form with an action of http://makeyourjewel.com/index.php/power/permissions_user/edit/ instead?

This is driving me insane because I don't know where to change this. This code has been like this since I started working and I'm currently looking at Magento default base files to compare, please help!

1 Answer 1

1

This looks like it is supposed to look.
The actual save is done in a separate actions.
One action does not respond differently depending on the verb you are using (get or post).
The add / edit form is displayed on the new or edit action, but it's the same form. The only difference is that on edit mode you have a hidden input with a non empty value (the id of the edited entity).

But in both add and edit, the actual save is done in a save action that is neither new or edit.
The difference is made based on the value of the hidden input value I mentioned above.

2
  • What's weird is I noticed that both forms come in as Post and go to the saveAction Method. There is this line of code "$id = $this->getRequest()->getParam('user_id');" but I echo the $id and its empty or null for both creating a user and editing a user so it is never true to exist? Commented May 24, 2017 at 22:12
  • I see that I am a fool. I was looking through my git history and in the Main.php that creates the form I changed $model->getUserId() to $user_id so it didn't know what I was talking about. Thanks your comment actually helped me look more in the right direction. Commented May 24, 2017 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.