[Bug 41058] New: Using Show Checkouts button when LoadCheckoutsTableDelay is set causes collision/error. loadIssuesTableDelayTimeoutId not assigned
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Bug ID: 41058 Summary: Using Show Checkouts button when LoadCheckoutsTableDelay is set causes collision/error. loadIssuesTableDelayTimeoutId not assigned Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: mike.grgurev@mainlib.org QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Manually selecting the "Show Checkouts" button does not cancel the setTimeout associated with LoadCheckoutsTableDelay (Checkouts table will show automatically in blah seconds..) In /intranet-tmpl/prog/js/checkouts.js, loadIssuesTableDelayTimeoutId is declared and targeted by clearTimeout() but never applied to the setTimeout() that triggers LoadIssuesTable(). Lines 712 & 735 should be revised from "setTimeout(function () {" to "loadIssuesTableDelayTimeoutId = setTimeout(function () {" -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 --- Comment #1 from Michael Grgurev <mike.grgurev@mainlib.org> --- https://github.com/grgurmg/Koha/blob/main/koha-tmpl/intranet-tmpl/prog/js/ch... -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Can you attach your patch here? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 --- Comment #3 from Michael Grgurev <mike.grgurev@mainlib.org> --- Created attachment 188492 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188492&action=edit [PATCH] Bug 41058: Assign timeout id when delaying issues table load Well.. hopefully I formatted this right. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Michael Grgurev <mike.grgurev@mainlib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Priority|P5 - low |P4 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |mike.grgurev@mainlib.org |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |lucas@bywatersolutions.com --- Comment #4 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Hey Michael, The code changes here look good! A few thing to point out: -The commit message should always start with "Bug XXXXX: " or else the Koha QA tools will complain, -Your must attach a test plan to your commit. If you can do those 2 things we can move this along. And thanks for the patch! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 --- Comment #5 from Michael Grgurev <mike.grgurev@mainlib.org> --- Ahhh, thanks Lucas! I knew my workflow was probably out of whack somewhere. Thought I had both of those in my patch file, but I'm clearly formatting/applying something wrong. I'll review everything and resubmit. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 --- Comment #6 from Lisette Scheer <lisette@bywatersolutions.com> --- Created attachment 191033 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191033&action=edit Bug 41058: Assign timeout id when delaying issues table load When AlwaysLoadCheckoutsTable is enabled and a delay is configured, we were calling setTimeout without capturing the returned id, despite a `loadIssuesTableDelayTimeoutId` variable already being declared and targetted by clearTimeout. This prevented the "Load now" button from properly clearing the pending timeout. Test plan: 1. Configure a delay (LoadCheckoutsTableDelay > 0) so checkouts table loads after N seconds. 2. Go to a patron’s checkouts page. 3. Before the delay completes, click "Load now". - Without this patch: an alert window will display a "Something went wrong when loading the table" error once the timeout triggers. - With this patch: the pending timeout is cleared; the table loads immediately only once. 4. Reload the page with the delay set; wait for the timeout to elapse and confirm the table loads normally. Signed-off-by: Mike Grgurev <mike.grgurev@mainlib.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191033|0 |1 is obsolete| | --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 191034 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191034&action=edit Bug 41058: Assign timeout id when delaying issues table load When AlwaysLoadCheckoutsTable is enabled and a delay is configured, we were calling setTimeout without capturing the returned id, despite a `loadIssuesTableDelayTimeoutId` variable already being declared and targetted by clearTimeout. This prevented the "Load now" button from properly clearing the pending timeout. Test plan: 1. Configure a delay (LoadCheckoutsTableDelay > 0) so checkouts table loads after N seconds. 2. Go to a patron’s checkouts page. 3. Before the delay completes, click "Load now". - Without this patch: an alert window will display a "Something went wrong when loading the table" error once the timeout triggers. - With this patch: the pending timeout is cleared; the table loads immediately only once. 4. Reload the page with the delay set; wait for the timeout to elapse and confirm the table loads normally. Signed-off-by: Mike Grgurev <mike.grgurev@mainlib.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m Attachment #188492|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Michael Grgurev <mike.grgurev@mainlib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mike.grgurev@mainlib.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191034|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 193267 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193267&action=edit Bug 41058: Assign timeout id when delaying issues table load When AlwaysLoadCheckoutsTable is enabled and a delay is configured, we were calling setTimeout without capturing the returned id, despite a `loadIssuesTableDelayTimeoutId` variable already being declared and targetted by clearTimeout. This prevented the "Load now" button from properly clearing the pending timeout. Test plan: 1. Configure a delay (LoadCheckoutsTableDelay > 0) so checkouts table loads after N seconds. 2. Go to a patron’s checkouts page. 3. Before the delay completes, click "Load now". - Without this patch: an alert window will display a "Something went wrong when loading the table" error once the timeout triggers. - With this patch: the pending timeout is cleared; the table loads immediately only once. 4. Reload the page with the delay set; wait for the timeout to elapse and confirm the table loads normally. Signed-off-by: Mike Grgurev <mike.grgurev@mainlib.org> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes an error message release notes| |when viewing the checkouts | |table for patrons, under | |either the patron's check | |out and details sections in | |the staff interface, where: | |- the | |LoadCheckoutsTableDelay | |system preference is set | |(greater than zero) | |- "Always show checkouts | |automatically" is selected | | | |Clicking "Show checkouts" | |when "Checkouts table will | |show automatically in X | |seconds..." is shown | |resulted in a pop-error | |message, after the table | |with the list of checkouts | |was shown: | | Something went wrong when | |loading the table | | 200: OK. CC| |david@davidnind.com --- Comment #9 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. Check out some items to a patron (I checked out two items to Mary Burton - 39999000000498, 39999000011418). 2. In either the patron's check out or details section, tick "Always show checkouts automatically". 3. Set the LoadCheckoutsTableDelay system preference to 5. 4. Go back to the patron's page - either the check out or details section. 5. Next to "Show checkouts", there is "Checkouts table will show automatically in 5 seconds..." 6. I found reproducing step 5 and the error described in the bug a bit hit in miss. This is what I did: . Sometimes the error message didn't show, other times it did . I switched between the check out and details section after selected and unselecting "Always show checkouts automatically" . When you do get "Checkouts table will show automatically in 5 seconds..." to show, click on the "Show checkouts" button . Don't do anything else after the check outs table is shown . Eventually (generally quite quickly, but sometimes a bit longer, it may be the time set for the LoadCheckoutsTableDelay system preference) this pop-up message is shown: Something went wrong when loading the table 200: OK. 7. Apply the patch, restart_all, clear your browser cache. 8. Repeat steps 5 and 6 - no pop-up error message is shown. 7. After the patch, and when you can get "Checkouts table will show automatically in 5 seconds..." to show, the pop-up error message no longer shows. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bibliothek@th-wildau.de --- Comment #10 from Jan Kissig <bibliothek@th-wildau.de> --- @David Nind, as you made the second SO was it meant to be QA? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 --- Comment #11 from David Nind <david@davidnind.com> --- (In reply to Jan Kissig from comment #10)
@David Nind, as you made the second SO was it meant to be QA?
Hi Jan. Just a normal sign-off, not QA (Mike was the author of the patch). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41930 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41930 [Bug 41930] LoadCheckoutsTableDelay is not working on moremember.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |bibliothek@th-wildau.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193267|0 |1 is obsolete| | --- Comment #12 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 193850 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193850&action=edit Bug 41058: Assign timeout id when delaying issues table load When AlwaysLoadCheckoutsTable is enabled and a delay is configured, we were calling setTimeout without capturing the returned id, despite a `loadIssuesTableDelayTimeoutId` variable already being declared and targetted by clearTimeout. This prevented the "Load now" button from properly clearing the pending timeout. Test plan: 1. Configure a delay (LoadCheckoutsTableDelay > 0) so checkouts table loads after N seconds. 2. Go to a patron’s checkouts page. 3. Before the delay completes, click "Load now". - Without this patch: an alert window will display a "Something went wrong when loading the table" error once the timeout triggers. - With this patch: the pending timeout is cleared; the table loads immediately only once. 4. Reload the page with the delay set; wait for the timeout to elapse and confirm the table loads normally. Signed-off-by: Mike Grgurev <mike.grgurev@mainlib.org> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This fixes an error message |This fixes an error message release notes|when viewing the checkouts |when viewing the checkouts |table for patrons, under |table for patrons, under |either the patron's check |the patron's check out |out and details sections in |section in the staff |the staff interface, where: |interface, where: |- the |- the |LoadCheckoutsTableDelay |LoadCheckoutsTableDelay |system preference is set |system preference is set |(greater than zero) |(greater than zero) |- "Always show checkouts |- "Always show checkouts |automatically" is selected |automatically" is selected | | |Clicking "Show checkouts" |Clicking "Show checkouts" |when "Checkouts table will |when "Checkouts table will |show automatically in X |show automatically in X |seconds..." is shown |seconds..." is shown |resulted in a pop-error |resulted in a pop-error |message, after the table |message, after the table |with the list of checkouts |with the list of checkouts |was shown: |was shown: | Something went wrong when | Something went wrong when |loading the table |loading the table | 200: OK. | 200: OK. --- Comment #13 from Jan Kissig <bibliothek@th-wildau.de> --- The patch works as intended. The delay is intended to work only on the check out page in order to prevent too many backend calls when checking out items. Now the intermediate click on 'show checkouts' won't raise an error when the table gets loaded finally. Note that 'show checkouts' on circulation.pl only works when AlwaysLoadCheckoutsTable is set to 'Don't'. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 --- Comment #14 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|26.05.00 |26.05.00,25.11.04 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41058 --- Comment #15 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org