From e1b660303f3adb6be633f8c35f56a778c90fc79c Mon Sep 17 00:00:00 2001 From: Emily Lamancusa Date: Tue, 3 Sep 2024 11:15:16 -0400 Subject: [PATCH] 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 Signed-off-by: Julian Maurice Signed-off-by: Katrin Fischer --- admin/aqcontract.pl | 1 - .../prog/en/modules/admin/aqcontract.tt | 17 +---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl index c1bca4a4c5..edb71f583a 100755 --- a/admin/aqcontract.pl +++ b/admin/aqcontract.pl @@ -92,7 +92,6 @@ if ( $op eq 'add_form' ) { #ADD_VALIDATE: called by add_form, used to insert/modify data in DB elsif ( $op eq 'cud-add_validate' ) { ## Please see file perltidy.ERR - $template->param( add_validate => 1 ); my $is_a_modif = $input->param("is_a_modif"); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt index ef6dffac5b..c8a6d5f859 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt @@ -15,9 +15,6 @@ [% IF ( else ) %] [% tx("Contracts of {vendor}", { vendor = booksellername }) | html %] [% END %] - [% IF ( add_validate ) %] - [% t("Data recorded") | html %] - [% END %] [% IF ( delete_confirm ) %] [% tx("Confirm deletion of contract '{contractnumber}'", { contractnumber = contractnumber }) | html %] [% END %] @@ -68,12 +65,6 @@ [% END %] [% END %] - [% IF ( add_validate ) %] - [% WRAPPER breadcrumb_item bc_active=1 %] - Data recorded - [% END %] - [% END %] - [% IF ( delete_confirm ) %] [% WRAPPER breadcrumb_item bc_active=1 %] Confirm deletion of contract [% contractnumber | html %] @@ -145,13 +136,7 @@ [% END %] - [% IF ( add_validate ) %] -

Data recorded

-
- [% INCLUDE 'csrf-token.inc' %] - -
- [% END %] + [% IF ( delete_confirm ) %]

Confirm deletion of contract [% contractname | html %]