Bug 37797 - Choosing not to delete a budget does not need to be a form submission
Summary: Choosing not to delete a budget does not need to be a form submission
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Emily Lamancusa
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks: 37728
  Show dependency treegraph
 
Reported: 2024-08-30 20:41 UTC by Emily Lamancusa
Modified: 2024-09-13 14:12 UTC (History)
3 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.11.00
Circulation function:


Attachments
Bug 37797: Change cancel button to a link styled as a button (1.83 KB, patch)
2024-08-30 20:57 UTC, Emily Lamancusa
Details | Diff | Splinter Review
Bug 37797: Change cancel button to a link styled as a button (1.89 KB, patch)
2024-09-03 11:02 UTC, Chloe Zermatten
Details | Diff | Splinter Review
Bug 37797: Change cancel button to a link styled as a button (1.96 KB, patch)
2024-09-13 12:01 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Emily Lamancusa 2024-08-30 20:41:51 UTC
On the confirmation page for deleting a budget, if the user selects "cancel", they are choosing not to perform an update. Currently the button is triggering a form POST with no op, but it really just needs to be a link back to the budget administration page.
Comment 1 Emily Lamancusa 2024-08-30 20:57:31 UTC
Created attachment 170928 [details] [review]
Bug 37797: Change cancel button to a link styled as a button

On the confirmation page for deleting a budget, change "Do not delete"
from a form submission to a link (styled to look like a button) in order
to avoid errors from POSTing with no op.

To test:
1. Go to Acquisitions > Budgets
2. Create a test budget
3. Attempt to delete the test budget
4. On the confirmation page, click "No, don't delete"
--> An error appears saying that the form was POSTed with no op!
5. Apply patch
6. Repeat steps 3-4
--> You are linked back to the Budgets page. The budget was not deleted.
Comment 2 Phil Ringnalda 2024-08-30 22:11:12 UTC
Interesting bustage, that the before state, which is supposed to be a POST without an op, was actually a POST with the wrong op. We have templates that set     $template->param(script_name=> to a string containing their actual path, but this one doesn't, so the template var script_name was apparently getting the path from the page's URL through some magic. Bet that's a whole new class of bug 36192 bustage we haven't yet noticed, where a script that was only getting POSTs now also gets GETs, and doesn't set script_name, and has a template that uses script_name.
Comment 3 Phil Ringnalda 2024-08-31 17:53:01 UTC
Oh, no magic, script_name isn't set so it's action="", which is the current page with its query string.
Comment 4 Chloe Zermatten 2024-09-03 11:02:41 UTC
Created attachment 170977 [details] [review]
Bug 37797: Change cancel button to a link styled as a button

On the confirmation page for deleting a budget, change "Do not delete"
from a form submission to a link (styled to look like a button) in order
to avoid errors from POSTing with no op.

To test:
1. Go to Acquisitions > Budgets
2. Create a test budget
3. Attempt to delete the test budget
4. On the confirmation page, click "No, don't delete"
--> An error appears saying that the form was POSTed with no op!
5. Apply patch
6. Repeat steps 3-4
--> You are linked back to the Budgets page. The budget was not deleted.

Signed-off-by: Chloe Zermatten <chloe.zermatten@ptfs-europe.com>
Comment 5 Phil Ringnalda 2024-09-04 01:46:55 UTC
Filed bug 37826 for the unset script_name problem.
Comment 6 Martin Renvoize 2024-09-13 12:01:55 UTC
Created attachment 171452 [details] [review]
Bug 37797: Change cancel button to a link styled as a button

On the confirmation page for deleting a budget, change "Do not delete"
from a form submission to a link (styled to look like a button) in order
to avoid errors from POSTing with no op.

To test:
1. Go to Acquisitions > Budgets
2. Create a test budget
3. Attempt to delete the test budget
4. On the confirmation page, click "No, don't delete"
--> An error appears saying that the form was POSTed with no op!
5. Apply patch
6. Repeat steps 3-4
--> You are linked back to the Budgets page. The budget was not deleted.

Signed-off-by: Chloe Zermatten <chloe.zermatten@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Katrin Fischer 2024-09-13 14:12:02 UTC
Pushed for 24.11!

Well done everyone, thank you!