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
Inventory page shows snail when not logged in #4249
Comments
Hello! Can I work on this issue? |
@agustinariq of course, you are very welcome to! However it might be something a bit difficult to tackle for a first issue. Don't hesitate to join us on Slack if you have any question! |
@RachL Great! What I've done so far is to create a method in the ApplicationController to redirect unauthenticated users to the login page and then call it in a before_filter in the problematic controller. What do you think? |
@agustinariq Thanks! I'm afraid I would be able to help you as I'm not a dev :) But maybe one of our @openfoodfoundation/developers can help you. |
hi @augnustin I think this will solve the problem, but I think we need to understand the problem. I think this problem is only occurring in non spree controllers that inherit from /admin/resource_controller Anyway, I think the solution should be added to |
Hi @augnustin! Another really good strategy to make sure that it works is to first write a test that fails in the same way as described here in the issue. Then you apply your fix and see if it works. In this case, a controller spec would be good. |
This issue has been linked to an error in Bugsnag |
Description
When visiting the inventory page from a link or a bookmark without logging in before, the application crashes and shows the snail.
Expected Behavior
Redirect to the login page.
Actual Behaviour
Server error display.
Steps to Reproduce
/admin/inventory
Context
There may be more pages like this.
Severity
bug-s4: it's annoying, but you can use it
Your Environment
Bugsnag
NoMethodError in admin/variant_overrides#index
undefined method `has_spree_role?' for nil:NilClass
View on Bugsnag
Stacktrace
View full stacktrace
Created by Maikel via Bugsnag
The text was updated successfully, but these errors were encountered: