aqcontract.tt has a few sections of code that were meant to display minimal confirmation messages (e.g. "Data recorded") after completing an action. However, this code is never reached, as aqcontract.pl simply redirects the page after completing the requested action. These unreachable sections of code use empty forms that are POSTed with no op or inputs, simply to display an "OK" button. This now violates coding guidelines, as submitting a form with method="post" and no "op" variable is no longer allowed. Since this code does nothing, it should simply be removed.
Created attachment 170990 [details] [review] Bug 37823: Remove unreachable code in vendor contract page The vendor contract management page has a few sections of code that are meant to display a minimal confirmation message ("Data recorded") after saving a new or edited vendor contract. However, aqcontract.pl redirects back to the vendor details page after saving, so this code is never reached and should be removed. Test plan: 1. Apply patch 2. Go to the Acquisitions module and find a vendor 3. Click + New > Contract 4. Fill in the information and click Save 5. Click the "Contracts" link in the navigation menu on the left --> Confirm that the contract was saved correctly 6. Click the Edit button and make changes to all fields 7. Save the information and click "Contracts" again --> Confirm that the new information saved correctly
Testing note: I found an unrelated bug that the input validation isn't working correctly if the start date and/or end date is missing. This bug is present with and without my patch - I filed bug 37825 for it.
Created attachment 171007 [details] [review] Bug 37823: Remove unreachable code in vendor contract page The vendor contract management page has a few sections of code that are meant to display a minimal confirmation message ("Data recorded") after saving a new or edited vendor contract. However, aqcontract.pl redirects back to the vendor details page after saving, so this code is never reached and should be removed. Test plan: 1. Apply patch 2. Go to the Acquisitions module and find a vendor 3. Click + New > Contract 4. Fill in the information and click Save 5. Click the "Contracts" link in the navigation menu on the left --> Confirm that the contract was saved correctly 6. Click the Edit button and make changes to all fields 7. Save the information and click "Contracts" again --> Confirm that the new information saved correctly Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Did you mean to handle the other one in the [% IF ( delete_confirmed ) %] block in this bug, too?
Wups, meant to ask that as a question, not to take away my signoff.
Created attachment 171128 [details] [review] Bug 37823: Remove unreachable code in vendor contract page The vendor contract management page has a few sections of code that are meant to display a minimal confirmation message ("Data recorded") after saving a new or edited vendor contract. However, aqcontract.pl redirects back to the vendor details page after saving, so this code is never reached and should be removed. Test plan: 1. Apply patch 2. Go to the Acquisitions module and find a vendor 3. Click + New > Contract 4. Fill in the information and click Save 5. Click the "Contracts" link in the navigation menu on the left --> Confirm that the contract was saved correctly 6. Click the Edit button and make changes to all fields 7. Save the information and click "Contracts" again --> Confirm that the new information saved correctly Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
It's always nice to see useless code removed, thanks Emily
Filed bug 37913 for the other one.
Pushed for 24.11! Well done everyone, thank you!
Backported to 24.05.x for upcoming 24.05.06