| Summary: | Suggestions table sharing localStorage for all tabs can prevent records from loading | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Brendan Lawlor <blawlor> |
| Component: | Acquisitions | Assignee: | Bugs List <koha-bugs> |
| Status: | NEW --- | QA Contact: | Testopia <testopia> |
| Severity: | normal | ||
| Priority: | P5 - low | ||
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
On suggestion.pl the local storage DataTables_acqui_suggestions_suggestions which saves the state for pagination is shared for all tabs, which can cause tabs to load with a bad state and fail to load records. To recreate: 1. Use ktd --dbshell to add a bunch of random suggestions with different statuses: INSERT INTO suggestions (suggestedby, suggesteddate, title, status) SELECT borrowernumber, '2025-10-29', firstname, ELT(0.5 + RAND() *6, 'ASKED', 'CHECKED', 'ACCEPTED', 'REJECTED', 'ORDERED', 'AVAILABLE' ) from borrowers; 2. If you are lucky you will have one tab with more than 20 records and one with less than 20, if not use the ui to adjust the statuses so that you do 3. Click on a tab with more than 20 records 4. Click Next > to go to the second page 5. Notice in local storage now DataTables_acqui_suggestions_suggestions.start is now 20 6. Click on a tab with fewer than 20 records 7. Notice the table says something illogical like: Showing 21 to 11 of 11 entries 8. And no records load :( 9. Click <<First to fix the pagination issue 10. Notice DataTables_acqui_suggestions_suggestions.start is now 0 again 11. The table loads with records :) Showing 1 to 11 of 11 entries