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.
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.
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.
Oh, no magic, script_name isn't set so it's action="", which is the current page with its query string.
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>
Filed bug 37826 for the unset script_name problem.
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>
Pushed for 24.11! Well done everyone, thank you!