Bug 41133 - Suggestions table sharing localStorage for all tabs can prevent records from loading
Summary: Suggestions table sharing localStorage for all tabs can prevent records from ...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-29 16:14 UTC by Brendan Lawlor
Modified: 2025-10-29 16:14 UTC (History)
0 users

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brendan Lawlor 2025-10-29 16:14:40 UTC
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