Summary: | Saved configuration states on tables cause extra columns to show | ||
---|---|---|---|
Product: | Koha | Reporter: | Jason Robb <jrobb> |
Component: | Staff interface | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | In Discussion --- | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | andrew, david, gmcharlt, jonathan.druart, mteal, roman.dolny |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: | Bug 39930: Fix SaveState on the orders table |
Description
Jason Robb
2025-05-16 21:36:06 UTC
We saw this in Acquisitions. When we search for Orders for a particular vendor, it shows a list of baskets. If you click on and open a basket, it correctly displays the orders table with the columns reflecting what is set up in Configuration. If you back arrow to get back to your list and select another basket, the columns remain correct. However, while you have a basket open, if you click on "Reopen basket", the Orders table displays with ALL the columns, even the ones selected to hide. From that point on, it continues to show all the columns no matter what baskets I pull up. You have to log out of Koha and back in to get the columns to reset back to what's in Configuration. Unchecking Save configuration state on page change prevents the problem from happening. I do recreate the problem on the orders table. When a basket is closed we lost 2 columns, DataTables cannot restore the state we previously stored (in localStorage) and use a default state: all columns displayed. I have not tried what Jason described on comment 0, but I guess it's a similar problem. It seems to be not trivial, at first glance I don't think we will be able to fix this globally, we will have to adjust the tables one by one. We will certainly one bug report per table. I was not aware of this bug, sorry to have missed it! Created attachment 184625 [details] [review] Bug 39930: Fix SaveState on the orders table Test plan: Open and close a basket On the orders table the issue appears because we show/hide columns depending on some conditions (sysprefs or if the basket is closed/opened). DataTables cannot correctly restore the state because the number of columns stored in localStorage is different than the one we have one the table. The orders table is, I think, fixed by this patch. However I don't recreate the problem with the checkouts or reports. Could do try in a sandbox and provide a clear test plan to recreate the problem? Or give me another table where the problem appears? Jason, would you be amenable to re-focusing this bug on just the acq orders table issue that Jonathan has recreated and patched? (In reply to Andrew Fuerste-Henry from comment #5) > Jason, would you be amenable to re-focusing this bug on just the acq orders > table issue that Jonathan has recreated and patched? It's cool with me if it helps the fix for the orders table move along. I did go through the steps I listed in my original bug report with an up-to-date ktd and it's still happening for me on the checkouts table. I did steps 1-3, then left it overnight and when I pulled the table up in the morning the extra columns had appeared. Not sure if its related but I noticed in the DataTables documentation that the default value for stateDuration is 7200 so maybe 2 hours is the minimum amount of time that needs to elapse between steps 3 and 4 to see the issue? |