solidus icon indicating copy to clipboard operation
solidus copied to clipboard

Using a Spree.user_class other than 'User' causes users/index view to break

Open incorvia opened this issue 3 years ago • 3 comments

Using a Spree.user_class other than 'User' (e.g. Account) causes users/index view to break because the method link_to_edit uses a polymorphic method of determining the URL helper and it results in 'undefined method edit_admin_account_url' error. It appears like Solidus needs this edit_admin_user_url.

Solidus Version: 2.11.7

To Reproduce Setup Spree to use a user_class called 'Account' and visit the admin users index page. It will error.

incorvia avatar Mar 28 '21 03:03 incorvia

Thanks for reporting. As far as I got, this will be solved when we'll merge this PR: https://github.com/solidusio/solidus/pull/2695. @spaghetticode can you please confirm when you have a moment?

kennyadsl avatar May 05 '21 08:05 kennyadsl

@kennyadsl the way the PR sits now it won't, as that PR doesn't change the admin routes. I bet is it will still call edit_admin_account_url which is not what we would have in the routes. This is one of the friction points we have when not using solidus_auth_devise.

spaghetticode avatar May 07 '21 08:05 spaghetticode

Is there any reason why we shouldn't just change all the polymorphic routes (e.g. link_to_edit) referring to admin users to non-polymorphic routes? (e.g. admin_edit_user_path)

seand7565 avatar May 25 '21 15:05 seand7565