-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User update form redirects to sign up form if form error #61
Comments
OK so I put in a temporary fix... not sure if it's what we would want but it works....I've put in an error_redirect variable in the user update form then added code to check for this in postIndex() and redirect if present otherwise default to 'user/create'.
|
Actually looking at this, I think it's more involved.... postIndex() is trying to handle the create user form submission and the update user form submission. The redirects and messages on success and failure relate to creating a new user, the functionality doesn't stand for the user update. Not sure if there should be a separate function to handle the update ... although I understand this is supposed to be a restful controller. I think perhaps this function should be renamed postCreate() and the creation form should submit to that then the functionality in postIndex() should be rewritten to handle the user update form. (By the way, I'm happy to get involved in code changes but I'm not sure how to do this in terms of sending pull request etc). I've made a few changes here and there locally which I should probably feed back. |
Think this is also related to #63 |
I was going to add in a postIndex() along the lines of:
but user->save() fails/returns false. Just reading a little about Ardent (I need to read more) and it appears you should just be able to use the form fields but not sure if this allows you to update email/username fields. |
If you user the /user route to display the update form, if there is an error it redirects to the create form.
I think the issue is that the registration form and update form both post to /user. The redirection to /user/create is probably there because of the registration form validation but doesn't work for the update form
Not sure on best way to fix... maybe separate post processing for update form, or have a conditional redirect depending on the form id or something?
The text was updated successfully, but these errors were encountered: