Skip to content

Changes to user record not reflected in form #26

@PhantomWatson

Description

@PhantomWatson

Because in UsersController::myAccount(), $this->set(compact('user')); comes before $user is modified by the request data, the form always displays what data was in the database before it was changed, rather than the request data that updated what was in the database.

Example:

  1. User's gender is "walrus"
  2. User goes to /users/my-account, changes it to "geode", and submits the form
  3. The database shows the user's gender as being changed to "geode"
  4. The resulting page displays "Your account has been updated", but the form still shows the gender as "walrus"
  5. Refreshing that page queries the database again, and the form now shows the updated gender

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions