-
Notifications
You must be signed in to change notification settings - Fork 30
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
Solidus nav items (modules) not appearing in Alchemy CMS #32
Comments
Which version of Solidus and Alchemy are you using? |
Sorry forgot to paste these in the original post Solidus 2.8.2 Thanks for the fast reply |
I should also mention, these are the routes - I placed Alchemy and Solidus at the top level, but I've also tried placing Solidus at /shop. Originally I didn't have the "scope" section below, and I had to add this to get the admin section to appear (based on Issue #14). scope :admin do Also: After fixing this issue it then threw: I'm assuming this was not limited to the homepage and would have appeared on all other pages as well, but I only have one page in the CMS so far. I just thought I'd mention this in case it might be of use to anyone, or in case the fact that those lines needed to be added might indicate an issue in my setup or in the gem itself. Thanks |
I just checked the Alchemy::User object for my admin account and found that spree_roles is empty, and Spree::Role is empty too. Is the user supposed to have Spree roles assigned? Alternatively, are we supposed to define cancan abilities anywhere? I'm just thinking it might be a permissions issue, as when I'm in the Alchemy backend and go to admin/users, it redirects to a Solidus page (with Solidus logo and page layout) and says "Authorization failure". This tells me that Solidus isn't seeing the account as an admin, although it's signed in successfully in the Alchemy backend |
From your notes above it seams you didn’t follow the setup guide from the README. What happens if you follow it? |
I did follow the readme several times over (creating and destroying the installation and I wasn't able to get around this particular issue) but I'll repeat the installation from the start and report back, thanks |
Hi Thomas, I'd just like to confirm whether I'm following the steps correctly: Note that I'm trying to set it up with Alchemy Devise as the user model I tried the automated install by adding gem 'alchemy-solidus', github: 'AlchemyCMS/alchemy-solidus', branch: 'master' and then running bin/rails g alchemy:solidus:install. This complained about not having a User object so I added alchemy-devise gem and the alchemy:solidus:install proceeded to the stage where I enter the admin credentials. Immediately after entering the credentials, it failed with Table '_development.spree_roles' doesn't exist (Mysql2::Error). So instead I decided to follow the manual instructions Option 2, existing Alchemy CMS installation with Alchemy Devise, as follows:
I then went to /admin and it redirected to /unauthorized and gave a 404 error - I'm assuming this is because Solidus caught the /admin route and has no /unauthorized route, but I was able to go to /admin/signup and /admin/login etc successfully (just not /admin itself). I can fix the /admin route issue, however the original issue remains where I can't see any links in the main Alchemy nav which point to Solidus. Are the steps followed correct at all? Just a side note: I appreciate your help |
If someone just requests '/admin' without being logged in Solidus renders '/unauthorized'. In solidus_auth_devise there is a redirect handler for this case that redirects to '/login'. In case we do not have solidus_auth_devise we need to provide a handler that redirects to Alchemy.login_path. Refs AlchemyCMS#32
If someone just requests '/admin' without being logged in Solidus renders '/unauthorized'. In solidus_auth_devise there is a redirect handler for this case that redirects to '/login'. In case we do not have solidus_auth_devise we need to provide a handler that redirects to Alchemy.login_path. Refs AlchemyCMS#32
@itanywhere thanks for reporting. I investigated and found some issues. They should all be fixed by #34. Could you please upgrade to latest
This happens if you did not ran the Solidus installer yet (
Fixed by removing the "Reports" tab from the alchemy module. Solidus moved this into an extension. I also moved the initialiser into a file that gets generated in the host app, so one can easily make changes to that file. Please re-run the I could not reproduce the problems with the Solidus nav items not appearing in Alchemy admin, though. But maybe this is fixed for you as well with all the fixes I made recently. Fingers crossed. |
@itanywhere #34 has now be merged. Please update to latest |
Thanks, I'll give it a test now |
@tvdeyen Just an update I created a new project and changed the paths in authentication_helpers.rb, however these threw some errors about the routes until I ran rake routes and found that the only change in Alchemy was in "admin_signup" (the login_path and logout_path remained the same). So I changed authentication_helpers.rb to:
and left Alchemy CMS itself now appears to work normally I also noticed the routes.rb file now looks like this:
instead of the README which says:
Should the routes.rb remain as above, or should I change it to the one in the readme? I'm trying to mount Alchemy and Spree at root level Also I have these in my Gemfile:
Are these correct? Or should I just have Alchemy-Solidus and Alchemy-Devise? Unfortunately the Solidus nav issue still persists, the Alchemy menu has Dashboard Pages Languages Sites Users Tags Library but nothing linking it to Solidus. I noticed your changes in config/initializers/alchemy.rb for the Reports tab - actually I did some research on Solidus last week and found that they had moved Reports to its own standalone gem and I even installed the gem before my original post in the hope that it would fix this issue. There's also another issue that I haven't raised yet (I was originally waiting to see if the fix for the nav would fix this too) - When going to the Users section in Alchemy, I get the following error: Thanks for looking into these issues and for releasing the fix for the links issue |
@tvdeyen Hey Thomas Through some miracle, I got it to work - well I got a lot closer The funny part is the Solidus menu item now appears twice in the CMS menu (image below). The Solidus admin section appears and works fine otherwise. This is how I got it to work Just a side note, the Automated option requires Spree to be installed first, with If these steps are required (and I haven't done something wrong) then it might be worth adding these two pointers into the Readme The remaining issues
|
@itanywhere I really need an example application in order to help you any further. The projects I am using this in, work fine. Also a fresh install works fine for me. Please upload a fresh install that shows this problems you are having somewhere on GitHub, so I can have a look. Otherwise I am not able to help. Sorry |
@tvdeyen Thanks Thomas, I've create a private repository to which you're added as a collaborator. Regarding the double Spree icon in the Alchemy menu, I fixed this by deleting config/initializers/alchemy.rb as I noticed this does the same job as the equivalent file in the gem folder. It's using Spree for the User section, is this correct? I had to modify the routes file to redirect the Spree POST /admin/users (new user) to the /alchemy/admin/users#create path Thanks for looking into it |
Fixed by #57 |
Alchemy-Solidus is not creating the tabs in the Alchemy main nav
Environment:
Rails 5.2.2
ruby 2.6.1p33 (2019-01-30 revision 66950)
Ubuntu 18.04
Installed Alchemy with Alchemy Devise, then Solidus and Solidus-Reports and Alchemy-Solidus. Installation steps as follows:
bin/rake alchemy_devise:install
bin/rake alchemy_devise:install:migrations
bin/rake alchemy:install
bundle exec rails g spree:install --sample=false
bundle exec rails g spree:custom_user Alchemy::User
bundle exec rails g solidus_reports:install
bundle exec rake alchemy_solidus:install:migrations
Verified that alchemy-solidus gem is creating the config/initializers/alchemy.rb file with the module correctly defined
The text was updated successfully, but these errors were encountered: