Skip to content
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

Admin view locations should be added first #2557

Closed
AndreiMaz opened this issue Sep 12, 2017 · 0 comments
Closed

Admin view locations should be added first #2557

AndreiMaz opened this issue Sep 12, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@AndreiMaz
Copy link
Member

Currently when you open the public area the view locations are properly ordered from the ThemeableViewLocationExpander as the themeable locations are added first.

"/Themes/DefaultClean/Views/{1}/{0}.cshtml"
"/Themes/DefaultClean/Views/Shared/{0}.cshtml"
"/Views/{1}/{0}.cshtml"
"/Views/Shared/{0}.cshtml"

But in the Admin are this is a problem as the Admin area locations should be first instead.
Now in the Admin are the locations are like this:

"/Themes/DefaultClean/Views/{1}/{0}.cshtml"
"/Themes/DefaultClean/Views/Shared/{0}.cshtml"
"/Areas/{2}/Views/{1}/{0}.cshtml"
"/Areas/{2}/Views/Shared/{0}.cshtml"
"/Views/Shared/{0}.cshtml"

This way if you override the Home/Index view in the DefaultClean theme and try to visit the administration, you will end up with the Home page in the public area.

You can easily check if the AreaName is "Admin" and in this case add the Admin view locations first and also there is no need to add the Themeable view locations at all as the administration should not be themeable anyway (at least in 3.9 it wasn't).

Please note that almost every theme (except DefaultClean) overrides the Home/Index view.

Source: https://www.nopcommerce.com/boards/t/48672/nopcommerce-40-bug-fixes-and-improvements.aspx#192807

@AndreiMaz AndreiMaz added the bug label Sep 12, 2017
@AndreiMaz AndreiMaz added this to the Version 4.00 milestone Sep 12, 2017
RomanovM added a commit that referenced this issue Sep 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants