Bug 37489 - Cannot delete patron image without uploading a file
Summary: Cannot delete patron image without uploading a file
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Sam Lau
QA Contact: David Cook
URL:
Keywords:
Depends on: 36192
Blocks:
  Show dependency treegraph
 
Reported: 2024-07-26 06:55 UTC by David Cook
Modified: 2024-08-29 17:31 UTC (History)
4 users (show)

See Also:
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:


Attachments
Bug 37489: Separate forms for uploading and deleting a patron image (3.35 KB, patch)
2024-07-26 16:22 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 37489: Separate forms for uploading and deleting a patron image (3.40 KB, patch)
2024-07-26 16:54 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 37489: Separate forms for uploading and deleting a patron image (3.45 KB, patch)
2024-07-29 01:19 UTC, David Cook
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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