Bug 39800

Summary: Error 500 when trying to delete patron card template
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: Label/patron card printingAssignee: Hammat wele <hammat.wele>
Status: Pushed to main --- QA Contact: Emily Lamancusa (emlam) <emily.lamancusa>
Severity: normal    
Priority: P5 - low CC: caroline.cyr-la-rose, emily.lamancusa, hammat.wele, philippe.blouin
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:
Attachments: Bug 39800: Error 500 when trying to delete patron card template
Bug 39800: Error 500 when trying to delete patron card template
Bug 39800: Error 500 when trying to delete patron card template

Description Caroline Cyr La Rose 2025-05-01 15:29:11 UTC
I noticed this on 24.05.05, but it also happens on main. When you try to delete the default patron card template, Koha returns a 500 error. I thought it was maybe because the patron card template was linked to a printer profile and this blocked the deletion, but I doesn't seem like it. If we edit the card template (without changing anything), then we can delete it.

To recreate:
1. Go to Tools > Patron card creator
2. Click Manage > Card templates
3. Click Delete next to the HB-PC0001 template
--> Error 500
4. Go back, and click Edit next to the HB-PC0001 template
5. Don't change anything, and click Save
6. Click Delete next to the HB-PC0001 template and confirm
--> Card template is deleted

Same goes for a printer profile (with fresh db)

To recreate:
0. reset_all
1. Go to Tools > Patron card creator
2. Click Manage > Printer profiles
3. Click Delete next to the '16' printer profile
--> Error 500
4. Go back, and click Edit next to the '16' profile
5. Don't change anything, and click Save
6. Click Delete next to the '16' printer profile
--> Printer profile is deleted
Comment 1 Hammat wele 2025-05-14 14:44:15 UTC
Created attachment 182453 [details] [review]
Bug 39800: Error 500 when trying to delete patron card template

Test plan:

1. Go to Tools > Patron card creator
2. Click Manage > Card templates
3. Click Delete next to the HB-PC0001 template
--> Error 500
4. Go back to Tools > Patron card creator
5. Click Manage > Printer profiles
6. Click Delete next to the '16' printer profile
--> Error 500
7. Apply the patch
8. Repeat step 1, 2, 3
--> Card template is deleted
9. Repeat step 4, 5, 6
--> Printer profilesis deleted
Comment 2 Owen Leonard 2025-05-14 15:25:54 UTC
Created attachment 182457 [details] [review]
Bug 39800: Error 500 when trying to delete patron card template

Test plan:

1. Go to Tools > Patron card creator
2. Click Manage > Card templates
3. Click Delete next to the HB-PC0001 template
--> Error 500
4. Go back to Tools > Patron card creator
5. Click Manage > Printer profiles
6. Click Delete next to the '16' printer profile
--> Error 500
7. Apply the patch
8. Repeat step 1, 2, 3
--> Card template is deleted
9. Repeat step 4, 5, 6
--> Printer profilesis deleted

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Emily Lamancusa (emlam) 2025-05-16 20:34:46 UTC
Created attachment 182557 [details] [review]
Bug 39800: Error 500 when trying to delete patron card template

Test plan:

1. Go to Tools > Patron card creator
2. Click Manage > Card templates
3. Click Delete next to the HB-PC0001 template
--> Error 500
4. Go back to Tools > Patron card creator
5. Click Manage > Printer profiles
6. Click Delete next to the '16' printer profile
--> Error 500
7. Apply the patch
8. Repeat step 1, 2, 3
--> Card template is deleted
9. Repeat step 4, 5, 6
--> Printer profilesis deleted

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Comment 4 Katrin Fischer 2025-05-19 07:50:20 UTC
Pushed for 25.05!

Well done everyone, thank you!