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

undefined method `total_pages' for 30:Integer for zones in solidus 4.3.0 #5742

Open
rahul88787 opened this issue May 3, 2024 · 1 comment

Comments

@rahul88787
Copy link

Solidus Version:
4.3.0

To Reproduce
Login with admin and go to http://127.0.0.1:5000/ecommerce/admin/zones

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
    --> http://127.0.0.1:5000/ecommerce/admin/zones

Current behavior
It gives the error "undefined method `total_pages' for 30:Integer"
gems/solidus_backend-4.3.0/app/views/spree/admin/zones/index.html.erb where line #12 raised:

Expected behavior
It should display zone listing page

Screenshots
Screenshot 2024-05-03 at 1 08 12 PM
Screenshot 2024-05-03 at 1 08 19 PM

Desktop (please complete the following information):

  • OS: Mac
  • Browser: Chrome
  • Version: 13.1 (22C65)

Additional context

@forkata
Copy link
Contributor

forkata commented Aug 28, 2024

Hey @rahul88787, we are not able to reproduce this issue on a stock sandbox Solidus app on the v4.3 branch. Do you happen to have any customizations to the admin zones controller, the Spree::Zone model or a custom permission set applied to the user you are testing with?

Based on the stacktrace you have provided, it looks like the first argument to the paginate method is an Integer instead of the expected scope which should an ActiveRecord relation. The controller that sets the @zones would be a good place to start debugging this issue https://github.com/solidusio/solidus/blob/v4.3/backend/app/controllers/spree/admin/zones_controller.rb#L18

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