Bug 36739

Summary: Unable to delete a budget
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: AcquisitionsAssignee: Owen Leonard <oleonard>
Status: RESOLVED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00
Circulation function:
Attachments: Bug 36739: Correct CSRF change to budget deletions
Bug 36739: Correct CSRF change to budget deletions
Bug 36739: Correct CSRF change to budget deletions

Description Caroline Cyr La Rose 2024-04-30 21:17:58 UTC
I'm unable to delete a budget that has no funds, even with superlibrarian privileges.

To recreate:
1. Go to Administration > Budgets
2. Click New budget
3. Enter a start and end date, a name and an amount
   (For the test, I entered April 1st, 2024 to April 30, 2024, named the budget "April", and gave it an amount of 100)
4. Click Save
5. Go to Inactive budgets
6. Click Actions next to the budget and choose the Delete option
7. Click Yes, delete
8. Go to Inactive budgets
   --> The budget is still there
Comment 1 Caroline Cyr La Rose 2024-04-30 21:19:51 UTC
I noticed the budget name is not in the warning message in step 7, but the budget_period_id is in the URL, so I'm not sure what is happening.
Comment 2 Owen Leonard 2024-05-01 11:09:49 UTC
Created attachment 165957 [details] [review]
Bug 36739: Correct CSRF change to budget deletions

This is another instance of the deletion confirmation step getting
mistakenly auto-updated as if it were the deletion step. The
'delete_confirm' doesn't need the 'cud-' prefix, only the
'delete_confirmed' step.

To test, apply the patch and restart services.

- Test the process of deleting a budget.
- On the confirmation step you should see the name of the budget you're
  about to delete.
- After confirming, the deletion should complete correctly.
Comment 3 Caroline Cyr La Rose 2024-05-01 13:21:36 UTC
Created attachment 165966 [details] [review]
Bug 36739: Correct CSRF change to budget deletions

This is another instance of the deletion confirmation step getting
mistakenly auto-updated as if it were the deletion step. The
'delete_confirm' doesn't need the 'cud-' prefix, only the
'delete_confirmed' step.

To test, apply the patch and restart services.

- Test the process of deleting a budget.
- On the confirmation step you should see the name of the budget you're
  about to delete.
- After confirming, the deletion should complete correctly.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 4 Caroline Cyr La Rose 2024-05-01 13:22:04 UTC
Thanks Owen!
Comment 5 Marcel de Rooy 2024-05-17 09:24:32 UTC
Created attachment 166879 [details] [review]
Bug 36739: Correct CSRF change to budget deletions

This is another instance of the deletion confirmation step getting
mistakenly auto-updated as if it were the deletion step. The
'delete_confirm' doesn't need the 'cud-' prefix, only the
'delete_confirmed' step.

To test, apply the patch and restart services.

- Test the process of deleting a budget.
- On the confirmation step you should see the name of the budget you're
  about to delete.
- After confirming, the deletion should complete correctly.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Katrin Fischer 2024-05-17 10:05:03 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 7 Fridolin Somers 2024-05-29 13:24:09 UTC
Not for 23.11.x
Comment 8 Caroline Cyr La Rose 2024-07-04 19:27:22 UTC
Bug fix, nothing to add/edit in the Koha manual.