Bugzilla – Attachment 182957 Details for
Bug 40061
Cannot delete image from patron card creator
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40061: (follow-up) Delete last image using checkbox
Bug-40061-follow-up-Delete-last-image-using-checkb.patch (text/plain), 1.90 KB, created by
Owen Leonard
on 2025-06-04 18:21:28 UTC
(
hide
)
Description:
Bug 40061: (follow-up) Delete last image using checkbox
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-06-04 18:21:28 UTC
Size:
1.90 KB
patch
obsolete
>From d32ee7ec149439a3f016adbf53fa12feda5265fd Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 >--- > .../prog/en/modules/patroncards/image-manage.tt | 9 +++++---- > 1 file changed, 5 insertions(+), 4 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 c7b9d207e32..077eaadc194 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 >@@ -175,10 +175,11 @@ > > function selected_images() { > var image_ids = new Array(); >- if (document.delete_images.image_id.length) { >- for (i = 0; i < document.delete_images.image_id.length; i++) { >- if (document.delete_images.image_id[i].checked) { >- image_ids.push(document.delete_images.image_id[i].value); >+ let checkboxes = document.getElementsByName("image_id"); >+ if (checkboxes.length) { >+ for (i = 0; i < checkboxes.length; i++) { >+ if (checkboxes[i].checked) { >+ image_ids.push(checkboxes[i].value); > } > } > } >-- >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 40061
:
182946
|
182957
|
182959
|
182960
|
183039
|
183040