Bug 37489

Summary: Cannot delete patron image without uploading a file
Product: Koha Reporter: David Cook <dcook>
Component: PatronsAssignee: Sam Lau <samalau>
Status: Pushed to stable --- QA Contact: David Cook <dcook>
Severity: normal    
Priority: P5 - low CC: gmcharlt, kyle.m.hall, lucas, samalau
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.04
Circulation function:
Bug Depends on: 36192    
Bug Blocks:    
Attachments: Bug 37489: Separate forms for uploading and deleting a patron image
Bug 37489: Separate forms for uploading and deleting a patron image
Bug 37489: Separate forms for uploading and deleting a patron image

Description David Cook 2024-07-26 06:55:50 UTC
We've got the upload file field as a required field for patron image, which means that if you try to delete the existing patron image... it won't work because it'll prompt you to upload an image.

Basically there is 1 HTML form and there should be 2. Should be an easy fix, but I'm not working on it currently.
Comment 1 Sam Lau 2024-07-26 16:22:47 UTC
Created attachment 169754 [details] [review]
Bug 37489: Separate forms for uploading and deleting a patron image

This patch creats a new form for image deletion that is submitted via the 'Delete' button on the modal.

To test:
1) Turon on the 'patronimages' sys pref
2) Visit a patron page, you should see an image module on the left.
3) Click on the image to edit it. Upload a new image.
4) Edit the image again, press delete and confirm the popup.
5) Note that it will not let you delete because of the required file.
6) Apply patch
7) Attempt to delete again, this time it is successful.
Comment 2 Roman Dolny 2024-07-26 16:54:50 UTC
Created attachment 169766 [details] [review]
Bug 37489: Separate forms for uploading and deleting a patron image

This patch creats a new form for image deletion that is submitted via the 'Delete' button on the modal.

To test:
1) Turon on the 'patronimages' sys pref
2) Visit a patron page, you should see an image module on the left.
3) Click on the image to edit it. Upload a new image.
4) Edit the image again, press delete and confirm the popup.
5) Note that it will not let you delete because of the required file.
6) Apply patch
7) Attempt to delete again, this time it is successful.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 3 David Cook 2024-07-29 01:19:32 UTC
Created attachment 169803 [details] [review]
Bug 37489: Separate forms for uploading and deleting a patron image

This patch creats a new form for image deletion that is submitted via the 'Delete' button on the modal.

To test:
1) Turon on the 'patronimages' sys pref
2) Visit a patron page, you should see an image module on the left.
3) Click on the image to edit it. Upload a new image.
4) Edit the image again, press delete and confirm the popup.
5) Note that it will not let you delete because of the required file.
6) Apply patch
7) Attempt to delete again, this time it is successful.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Comment 4 Katrin Fischer 2024-08-01 16:27:34 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 5 Lucas Gass 2024-08-29 17:31:28 UTC
Backported to 24.05.x for upcoming 24.05.04