[Koha-bugs] [Bug 35535] Cancel hold -button does not work in pop-up (Hold found, item is already waiting)

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Dec 14 10:17:06 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35535

--- Comment #1 from Andreas Jonsson <andreas.jonsson at kreablo.se> ---
This will happen if there are no authorised values in the category
HOLD_CANCELLATION, because no select input element will be rendered in this
case so the javascript code references an undefined element.

This could be made more robust by adding a default reason if the element is
missing:

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
index 2abde7f9c5..92a375531e 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
@@ -1562,7 +1562,8 @@
                 this.form.submit();
             });
             $('.cancel-hold').on("click",function(e){
-                let cancel_reason =
document.getElementById('cancellation-reason').value;
+                const r = document.getElementById('cancellation-reason');
+                let cancel_reason = r ? r.value : 'Manually cancelled';
                 this.form.cancel_reserve.value = 1;
                 this.form.cancel_reason.value = cancel_reason;
                 this.form.submit();

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list