Bugzilla – Attachment 194909 Details for
Bug 42013
Confirmation dialog for "Remove all reserves" never shown on course details page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 42013: Fix missing confirmation dialog for "Remove all reserves"
Bug-42013-Fix-missing-confirmation-dialog-for-Remo.patch (text/plain), 2.47 KB, created by
Roman Dolny
on 2026-03-06 20:54:05 UTC
(
hide
)
Description:
Bug 42013: Fix missing confirmation dialog for "Remove all reserves"
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2026-03-06 20:54:05 UTC
Size:
2.47 KB
patch
obsolete
>From f19e99fcb0f707ed87170959493075e3ea8ba7dc Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Fri, 6 Mar 2026 13:43:23 +0100 >Subject: [PATCH] Bug 42013: Fix missing confirmation dialog for "Remove all > reserves" > >- The confirmDelete dialog for removing all reserves from a course > was bound as a click handler on the #rm_items form element, which > is never directly clicked by the user >- The #rm_items_button click handler called .submit() on the form > without checking confirmDelete first, bypassing the confirmation >- Move the confirmDelete check into the #rm_items_button click > handler and remove the dead #rm_items click handler > >Test plan: >- Enable UseCourseReserves system preference (should be enabled in ktd) >- Create a course (or use the existing one) and add at least one reserve to it >- On the course details page, click "Remove all reserves" >- Observe the form submits immediately without confirmation >- Apply patch >- Repeat the steps above >- Verify a confirmation dialog now appears >- Click cancel and verify the reserves are not removed >- Click "Remove all reserves" again, confirm, and verify > the reserves are removed > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > .../prog/en/modules/course_reserves/course-details.tt | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >index f0002c6313..ab66444410 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >@@ -370,7 +370,9 @@ > }); > $("#rm_items_button").on( 'click', function(e){ > e.preventDefault(); >- $('#rm_items').submit(); >+ if (confirmDelete(_("Are you sure you want to remove all items from the course?"))) { >+ $('#rm_items').submit(); >+ } > }); > > var rtable = $("#course_reserves_table").kohaTable( >@@ -389,10 +391,6 @@ > } > }); > >- $("#rm_items").click(function(){ >- return confirmDelete(_("Are you sure you want to remove all items from the course?")); >- }); >- > $("#delete_course").click(function(){ > [% SET count = course_reserves.size || 0 %] > [% IF count == 1 %] >-- >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 42013
:
194699
| 194909