Bugzilla – Attachment 188492 Details for
Bug 41058
Using Show Checkouts button when LoadCheckoutsTableDelay is set causes collision/error. loadIssuesTableDelayTimeoutId not assigned
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] Bug 41058: Assign timeout id when delaying issues table load
Bug-41058-Assign-timeout-id-when-delaying-issues-table-load.patch (text/plain), 2.44 KB, created by
Michael Grgurev
on 2025-10-27 22:18:34 UTC
(
hide
)
Description:
[PATCH] Bug 41058: Assign timeout id when delaying issues table load
Filename:
MIME Type:
Creator:
Michael Grgurev
Created:
2025-10-27 22:18:34 UTC
Size:
2.44 KB
patch
obsolete
>From 9e5e13c852609368806f2b305364d917db57e2c5 Mon Sep 17 00:00:00 2001 >From: grgurmg <99843025+grgurmg@users.noreply.github.com> >Date: Mon, 20 Oct 2025 14:14:55 -0400 >Subject: [PATCH] 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> >--- > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 185a5488db5..692a93cc412 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -709,7 +709,7 @@ var barcodefield = $("#barcode"); > > if (AlwaysLoadCheckoutsTable) { > if (LoadCheckoutsTableDelay) { >- setTimeout(function () { >+ loadIssuesTableDelayTimeoutId = setTimeout(function () { > LoadIssuesTable(); > }, LoadCheckoutsTableDelay * 1000); > } else { >@@ -725,14 +725,14 @@ if (AlwaysLoadCheckoutsTable) { > $("#issues-table-load-now-button").click(function () { > if (loadIssuesTableDelayTimeoutId) > clearTimeout(loadIssuesTableDelayTimeoutId); >- LoadIssuesTable(); >+ LoadIssuesTable(); > barcodefield.focus(); > return false; > }); > > if (Cookies.get("issues-table-load-immediately-" + script) == "true") { > if (LoadCheckoutsTableDelay) { >- setTimeout(function () { >+ loadIssuesTableDelayTimeoutId = setTimeout(function () { > LoadIssuesTable(); > }, LoadCheckoutsTableDelay * 1000); > } else {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41058
: 188492