From ffe35288cebf44a4ea69a9be781be68ba113c57e Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 4 Jun 2025 18:16:44 +0000 Subject: [PATCH] Bug 40061: (follow-up) Delete last image using checkbox This followup corrects a problem in image deletion which isn't really the same issue (it's not CSRF related) but is another problem with deletion. The JS for grabbing all the checkboxes by name wasn't working when there is only one checkbox. To test, apply the patch and delete all but one image from the patron card creator image manager. - Check the checkbox for the last image and click the "Delete selected" button. - The image should be deleted successfully. Sponsored-by: Athens County Public Libraries Signed-off-by: Caroline Cyr La Rose Signed-off-by: Marcel de Rooy Signed-off-by: Lucas Gass (cherry picked from commit 727b9d2dde7fd76013fd2d69bcd055ee5c8521a7) Signed-off-by: Paul Derscheid (cherry picked from commit d99a9e28b651426f2ce59b9fe428cb4ed2a4b7b2) Signed-off-by: Baptiste Wojtkowski --- .../prog/en/modules/patroncards/image-manage.tt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt index e174f583d3..24cc872268 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt @@ -194,11 +194,12 @@ } function selected_images() { - var image_ids = new Array; - if (document.delete_images.image_id.length) { - for (i=0;i