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

Updated from 3.0 to 3.2 and getting "No route matches [GET] "/admin/dashboard" #1244

Closed
dznicol opened this issue Mar 5, 2017 · 3 comments
Closed

Comments

@dznicol
Copy link

dznicol commented Mar 5, 2017

Hi,

I am upgrading from Alchemy 3.2 to 3.4.2. When I try to log in to the admin portal I get:

No route matches [GET] "/admin/dashboard

I have Alchemy mounted as:

mount Alchemy::Engine => '/content'

I go to /content/admin (which previously worked fine to access the admin portal) and I see a 301 redirect to /admin/dashboard

The CMS pages are rending fine using their previous URLs like /content/partners. This issue only seems to affect the admin pages.

I tried setting Alchemy.admin_path = '/content/admin' but that's worse, I get Alchemy::Page not found "/content/admin".

I am using rails 4.2.8.

Should I set admin_path if I am pointing at /content?

From routes.rb:

...
alchemy_path		/content	Alchemy::Engine
Routes for Alchemy::Engine
root_path	GET	/	alchemy/pages#index
GET	/sitemap.xml(.:format)	alchemy/pages#sitemap {:format=>/xml/}
admin_path	GET	/content/admin(.:format)	redirect(301, /content/admin/dashboard)
admin_dashboard_path	GET	/content/admin/dashboard(.:format)	alchemy/admin/dashboard#index
dashboard_info_path	GET	/content/admin/dashboard/info(.:format)	alchemy/admin/dashboard#info
help_path	GET	/content/admin/help(.:format)	alchemy/admin/dashboard#help
update_check_path	GET	/content/admin/dashboard/update_check(.:format)	
...

Thanks in advance for all help upgrading.

David

@tvdeyen
Copy link
Member

tvdeyen commented Mar 6, 2017

Do other routes like /content/admin/pages work?

@dznicol
Copy link
Author

dznicol commented Mar 6, 2017

Hi Thomas,

The other routes render fine. Even /content/admin/dashboard works.

It seems the issue is isolated to the /content/admin redirect.

Thanks in advance,

David

@dznicol
Copy link
Author

dznicol commented Mar 12, 2017

Is the solution maybe to re-introduce the mount point get method such as:

  get '/' => redirect("#{Alchemy::MountPoint.get}/#{Alchemy.admin_path}/dashboard")

I haven't had a chance to try this (dependency issues), but I saw something similar in the routes.rb history from 2015.

tvdeyen added a commit to tvdeyen/alchemy_cms that referenced this issue Nov 24, 2017
Since 871e77e we allow to set a custom
admin path (ie. `/backend` instead of `/admin`). The default is set to
`/admin` and since the admin dashboard redirect rule from `/admin` to
`/admin/dashboard` uses this value the redirect destination is a root
path.

This causes no problems, unless you mount Alchemy at some other path
(`/cms` instead of just `/`). Because the redirect rule has a leading
slash the Rails router does not take the mount path into account and
redirects to `/admin/dashboard` instead of `/cms/admin/dashboard`.

Closes AlchemyCMS#1244
tvdeyen added a commit to tvdeyen/alchemy_cms that referenced this issue Nov 24, 2017
Since 871e77e we allow to set a custom
admin path (ie. `/backend` instead of `/admin`). The default is set to
`/admin` and since the admin dashboard redirect rule from `/admin` to
`/admin/dashboard` uses this value the redirect destination is a root
path.

This causes no problems, unless you mount Alchemy at some other path
(`/cms` instead of just `/`). Because the redirect rule has a leading
slash the Rails router does not take the mount path into account and
redirects to `/admin/dashboard` instead of `/cms/admin/dashboard`.

Closes AlchemyCMS#1244
tvdeyen added a commit to tvdeyen/alchemy_cms that referenced this issue Nov 24, 2017
Since 871e77e we allow to set a custom
admin path (ie. `/backend` instead of `/admin`). The default is set to
`/admin` and since the admin dashboard redirect rule from `/admin` to
`/admin/dashboard` uses this value the redirect destination is a root
path.

This causes no problems, unless you mount Alchemy at some other path
(`/cms` instead of just `/`). Because the redirect rule has a leading
slash the Rails router does not take the mount path into account and
redirects to `/admin/dashboard` instead of `/cms/admin/dashboard`.

Closes AlchemyCMS#1244
tvdeyen added a commit to tvdeyen/alchemy_cms that referenced this issue Nov 24, 2017
Since 871e77e we allow to set a custom
admin path (ie. `/backend` instead of `/admin`). The default is set to
`/admin` and since the admin dashboard redirect rule from `/admin` to
`/admin/dashboard` uses this value the redirect destination is a root
path.

This causes no problems, unless you mount Alchemy at some other path
(`/cms` instead of just `/`). Because the redirect rule has a leading
slash the Rails router does not take the mount path into account and
redirects to `/admin/dashboard` instead of `/cms/admin/dashboard`.

Closes AlchemyCMS#1244
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants