To reproduce: 1) Go to Tools -> Patron Card Creator -> Manage Images. Upload an image if you do not already have something uploaded 2) Without checking any boxes, click the 'Delete selected' box 3) A box will pop up saying 'Please select image(s) to delete', as expected. Click 'OK' 4) Another pop-up saying 'Are you sure you want to delete image(s): undefined?' This is unexpected and shouldn't be showing up if nothing has been selected. 5) Click 'OK' - This also doesn't work (image isn't deleted) and gives an error 'WARNING: An error has occurred. Please ask your system administrator to check the error log for more details.' 6) Check the box next to an image and click 'Delete selected', then 'OK'. You get the WARNING error again and the image isn't deleted. This is broken.
Confirmed. I could delete an image using the button "Delete" in the same row. Selecting the image and using the button "Delete selected" results the warning as mentioned by Aleisha.
Created attachment 54801 [details] [review] Bug 15711: Fixing the 'Delete selected' button on patroncard images To test: 1) Go to Tools -> Patron Card Creator -> Manage images 2) Upload an image if you haven't already 3) Click Delete selected without selecting any images 4) Notice broken behaviour as described in Description 5) Apply patch, refresh page 6) Click Delete selected without selecting any images 7) Notice alert. Click OK 8) Select one image or more, click Delete selected 9) Notice confirm delete message. Sponsored-by: Catalyst IT
Created attachment 54879 [details] [review] [SIGNED-OFF] Bug 15711: Fixing the 'Delete selected' button on patroncard images To test: 1) Go to Tools -> Patron Card Creator -> Manage images 2) Upload an image if you haven't already 3) Click Delete selected without selecting any images 4) Notice broken behaviour as described in Description 5) Apply patch, refresh page 6) Click Delete selected without selecting any images 7) Notice alert. Click OK 8) Select one image or more, click Delete selected 9) Notice confirm delete message. Sponsored-by: Catalyst IT Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Aleisha, I get the exact same behavior with and without the patch: I get the first "Please select images to delete.", then "Are you sure you want to delete image(s): undefined?"
(In reply to Jonathan Druart from comment #4) > Aleisha, I get the exact same behavior with and without the patch: > I get the first "Please select images to delete.", then "Are you sure you > want to delete image(s): undefined?" Hi Jonathan, are you sure the patch applied correctly? I just applied and tested it again and it worked fine for me.
I still get the same behavior.
(In reply to Jonathan Druart from comment #6) > I still get the same behavior. 6 function DeleteConfirm() { 7 var results = selected_images("delete"); 8 if (results.images != 0) { It seems that selected_images returns -1, and so the if is evaluated true (results.images is undefined which is != 0)
Created attachment 57877 [details] [review] Bug 15711: Fixing the 'Delete selected' button on patroncard images To test: 1) Go to Tools -> Patron Card Creator -> Manage images 2) Upload an image if you haven't already 3) Click Delete selected without selecting any images 4) Notice broken behaviour as described in Description 5) Apply patch, refresh page 6) Click Delete selected without selecting any images 7) Notice alert. Click OK 8) Select one image or more, click Delete selected 9) Notice confirm delete message. Sponsored-by: Catalyst IT Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 57944 [details] [review] [SIGNED-OFF] Bug 15711: Fixing the 'Delete selected' button on patroncard images To test: 1) Go to Tools -> Patron Card Creator -> Manage images 2) Upload an image if you haven't already 3) Click Delete selected without selecting any images 4) Notice broken behaviour as described in Description 5) Apply patch, refresh page 6) Click Delete selected without selecting any images 7) Notice alert. Click OK 8) Select one image or more, click Delete selected 9) Notice confirm delete message. Sponsored-by: Catalyst IT Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 57945 [details] [review] [SIGNED-OFF] Bug 15711: Follow up batch_id not used Changed batch_id to image_id in the template, as the multiparam would catch the array case. TEST PLAN --------- 1) attempt to delete a selected item, but get a warning. 2) apply this follow up 3) attempt to delete a selected item, it deletes. 4) run koha qa test tools Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Given that I wrote the follow up, I think another sign off is in order. Additionally, encountered valid_template error unrelated to any of the changes made.
Created attachment 58189 [details] [review] [SIGNED-OFF] Bug 15711: Fixing the 'Delete selected' button on patroncard images To test: 1) Go to Tools -> Patron Card Creator -> Manage images 2) Upload an image if you haven't already 3) Click Delete selected without selecting any images 4) Notice broken behaviour as described in Description 5) Apply patch, refresh page 6) Click Delete selected without selecting any images 7) Notice alert. Click OK 8) Select one image or more, click Delete selected 9) Notice confirm delete message. Sponsored-by: Catalyst IT Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 58190 [details] [review] [SIGNED-OFF] Bug 15711: Follow up batch_id not used Changed batch_id to image_id in the template, as the multiparam would catch the array case. TEST PLAN --------- 1) attempt to delete a selected item, but get a warning. 2) apply this follow up 3) attempt to delete a selected item, it deletes. 4) run koha qa test tools Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 58444 [details] [review] Bug 15711: Fixing the 'Delete selected' button on patroncard images To test: 1) Go to Tools -> Patron Card Creator -> Manage images 2) Upload an image if you haven't already 3) Click Delete selected without selecting any images 4) Notice broken behaviour as described in Description 5) Apply patch, refresh page 6) Click Delete selected without selecting any images 7) Notice alert. Click OK 8) Select one image or more, click Delete selected 9) Notice confirm delete message. Sponsored-by: Catalyst IT Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 58445 [details] [review] Bug 15711: Follow up batch_id not used Changed batch_id to image_id in the template, as the multiparam would catch the array case. TEST PLAN --------- 1) attempt to delete a selected item, but get a warning. 2) apply this follow up 3) attempt to delete a selected item, it deletes. 4) run koha qa test tools Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 17.05, thanks Aleisha, Mark!
These patches have been pushed to 16.11.x and will be in 16.11.02. .
Pushed to 3.22.x for 3.22.15
Pushed to 16.05.x, for 16.05.08 release