Bugzilla – Attachment 190903 Details for
Bug 41247
ILL batches modal does not reset correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41247: Improve ILL batches modal resetability
Bug-41247-Improve-ILL-batches-modal-resetability.patch (text/plain), 4.39 KB, created by
David Nind
on 2026-01-05 18:45:56 UTC
(
hide
)
Description:
Bug 41247: Improve ILL batches modal resetability
Filename:
MIME Type:
Creator:
David Nind
Created:
2026-01-05 18:45:56 UTC
Size:
4.39 KB
patch
obsolete
>From d827041f2c0de54ba8315709913477aa8b302c6c Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Thu, 13 Nov 2025 14:12:13 +0000 >Subject: [PATCH] Bug 41247: Improve ILL batches modal resetability > >Test plan, preparation: >A) Enable ILLModule >B) Install a metadata enrichment plugin, e.g: >https://github.com/openfifth/koha-plugin-api-pubmed/releases/tag/1.1.1 >C) Restart plack to pick up the newly installed plugin if needed. >D) Create a new batch, visit: ><staff_url>/cgi-bin/koha/ill/ill-requests.pl? > >Issue #1: >1.1) Click 'New ILL requests batch' >1.2) Enter a name, '42' on the cardnumber and any library. Click 'Continue'. >1.3) Click the 'Close' button (or click anywhere outside the modal) to close the modal. >1.4) Repeat 1.1). Notice the 'Continue' button is no longer there. > >Issue #2: >2.1) Click 'New ILL requests batch' >2.2) Enter a name, '42' on the cardnumber and any library. Click 'Continue'. >2.3) Enter '123' on the textarea, click 'Process identifiers'. >2.4) Notice a 'Add items to batch' buttons appears. Don't click that, as before, close the modal. >2.5) Repeat 2.1) Notice the progress bar shows right off the bat (it shouldn't) with NaN as its value as well as table elements (export button, 'No entries to show' message, etc, with no table. > >Apply patch, hard-refresh the browser and repeat Issues 1 and 2. Confirm the patch fixes them. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../intranet-tmpl/prog/js/ill-batch-modal.js | 20 ++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-batch-modal.js b/koha-tmpl/intranet-tmpl/prog/js/ill-batch-modal.js >index 1051c5a3ca..552541d570 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/ill-batch-modal.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/ill-batch-modal.js >@@ -159,11 +159,10 @@ > }); > $("#ill-batch-modal").on("hidden.bs.modal", function () { > // Reset our state when we close the modal >- // TODO: need to also reset progress bar and already processed identifiers > delete elId.dataset.batchId; > delete elId.dataset.backend; > batchId = null; >- tableEl.style.display = "none"; >+ $("#identifier-table_wrapper").hide(); > tableContent.data = []; > progressTotals.data = { > total: 0, >@@ -173,6 +172,8 @@ > textarea.value = ""; > batch.data = {}; > cancelButton.innerHTML = cancelButtonOriginalText; >+ hideProgress(); >+ hideErrors(); > // Remove event listeners we created > removeEventListeners(); > }); >@@ -192,11 +193,13 @@ > isUpdate = true; > setModalHeading(); > finishButton.removeAttribute("disabled"); >- createButton.style.display = "none"; >+ hideCreateButton(); > } else { > batch.data = emptyBatch; > setModalHeading(); > finishButton.style.display = "none"; >+ createButton.style.display = "inline-block"; >+ createButton.setAttribute("disabled", 1); > } > fetchStatuses(); > finishButtonEventListener(); >@@ -399,7 +402,7 @@ > createButton.removeEventListener("click", createBatch); > identifierTable.removeEventListener("click", toggleMetadata); > identifierTable.removeEventListener("click", removeRow); >- createRequestsButton.remove("click", requestRequestable); >+ createRequestsButton.removeEventListener("click", requestRequestable); > } > > function finishButtonEventListener() { >@@ -637,6 +640,11 @@ > el.style.display = "block"; > } > >+ function hideProgress() { >+ var el = document.getElementById("create-progress"); >+ el.style.display = "none"; >+ } >+ > function showCreateRequestsButton() { > var data = progressTotals.data; > var el = document.getElementById("create-requests"); >@@ -729,6 +737,8 @@ > // Now build and display the table > if (!table) { > buildTable(); >+ } else { >+ tableEl.parentElement.style.display = "block"; > } > > // We may be appending new values to an existing table, >@@ -783,7 +793,7 @@ > } > > function hideCreateButton() { >- createButton.remove(); >+ createButton.style.display = "none"; > } > > async function populateMetadata(identifier) { >-- >2.39.5
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 41247
:
189572
|
189603
|
189604
|
189607
|
189608
|
189609
|
189618
| 190903 |
190904
|
190905