Bug 36739 - Unable to delete a budget
Summary: Unable to delete a budget
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Owen Leonard
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-30 21:17 UTC by Caroline Cyr La Rose
Modified: 2024-07-04 19:27 UTC (History)
2 users (show)

See Also:
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 (1.24 KB, patch)
2024-05-01 11:09 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36739: Correct CSRF change to budget deletions (1.31 KB, patch)
2024-05-01 13:21 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 36739: Correct CSRF change to budget deletions (1.41 KB, patch)
2024-05-17 09:24 UTC, Marcel de Rooy
Details | Diff | Splinter Review

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