-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
Changing the number of items per page fails #3667
Comments
Hi @filipegiusti, A reproduction repository isn't necessary if the issue can be easily reproduced at main avo demo. If that's the case, please provide the steps to reproduce the issue there. We always need a clear way to replicate issues to ensure we focus on the correct fix. If a reproduction repository is required, you can follow this quick guide: It should only take a couple of minutes to set up. Thank you! |
@Paul-Bob I've updated with a reproduction repository, let me know if you need anything else from me. |
Thank for the update @filipegiusti I have reproduced the issue, identified the problem, and submitted a PR with a fix. The reproduction repository was very helpful. |
@Paul-Bob thank you very much. |
Describe the bug
The per page links generated don't respect the current loaded resource.
And this causes changing the per page option to raise an unhandled exception or to show a "can't load has many association" error.
Reproduction repository for the bug
https://github.com/filipegiusti/per-page-bug
http://localhost:3000/avo/resources/coached_contacts/1
Steps to use in the reproduction repository
Steps to reproduce the behavior:
Expected behavior & Actual behavior
The per page attribute should change and the items should display.
The actual behavior is the error "Failed to load has many field show activities frame".
System configuration
Avo version: 3.17.6
Rails version: 7.2.2.1
Ruby version: 3.3.1
License type:
Are you using Avo monkey patches, overriding views or view components?
Screenshots or screen recordings
Additional context
We do have both Resources::Contact and Resources::CoachedContact and the later uses
self.model_class = Contact
. In the same vein we have Resources::Activity and Resources::ContactActivity.I was able to track down the issue to https://github.com/avo-hq/avo/blob/main/app/components/avo/paginator_component.rb#L15 the @parent_record is a
Contact
and the resource is aContactActivity
but the parent resource is aCoachedContact
.This wouldn't be so impactful to us if #2661 existed as we could put in sane defaults.
Impact
Urgency
The text was updated successfully, but these errors were encountered: