solidus
solidus copied to clipboard
Breadcrumbs displays invalid emails modifying users
When changing a user's email in the backend (/admin/users/:id
), if there is a validation error on the email, breadcrumbs of the page are updated with the wrong, invalid value.
Solidus Version:
master
To Reproduce
In sandbox:
- Go to Admin -> User -> Any user -> Account tab
- Change user's email with the email taken by another user and save
- Click Update button
Current behavior
Breadcrumbs are updated with the wrong email, even if there's an error on the page
Expected behavior
The old, persisted and valid email is displayed in breadcrumbs
Screenshots

👆 I'm actually editing [email protected]
Additional context
I suppose this happens because breacrumbs is using the ivar (maybe @user, or @object from Spree::Admin::ResourceController
) that contains the instance of the User with errors (and previously submitted params) and not the persisted one, which is valid.
I'm afraid this could happen in other pages as well, where the value that the user is trying to change to an invalid one is used to create breadcrumbs of that page.
@kennyadsl I'm not sure if this is the best approach to tackle this issue, but here is a possible solution https://github.com/solidusio/solidus/pull/3152
A PR was accepted to fix an edge case, and we are closing this because we are in the process of building a new version of the Solidus Admin, which will make this issue soon irrelevant.