From 09cc261d654ef4bd1c02180c196eef28a70f2978 Mon Sep 17 00:00:00 2001 From: Jan Kissig Date: Thu, 16 May 2024 11:23:31 +0200 Subject: [PATCH] Bug 36877: Fix Patron card creator errors on editing layout, profile or template Content-Type: text/plain; charset=utf-8 This patch fixes the unexpected behaviour when clicking on edit layout, edit profile or edit template in Patron card creator tool. Test plans: 1. edit layout: a) go to http://localhost:8081/cgi-bin/koha/patroncards/manage.pl?card_element=layout b) click on edit 'Test Layout' c) WARNING: An unsupported operation was attempted on layout 20. Please have your system administrator check the error log for details. apply patch a) go to http://localhost:8081/cgi-bin/koha/patroncards/manage.pl?card_element=layout b) click on edit 'Test Layout' c) Edit patron card layout form 20 shows up 2. edit template and profile: a) go to http://localhost:8081/cgi-bin/koha/patroncards/manage.pl?card_element=template or http://localhost:8081/cgi-bin/koha/patroncards/manage.pl?card_element=profile b) click edit on an item in the table c) notice that the forms are empty apply patch and redo steps a) and b) to load the edit form Signed-off-by: Owen Leonard Signed-off-by: Marcel de Rooy --- koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt | 2 +- patroncards/edit-layout.pl | 2 +- patroncards/edit-profile.pl | 2 +- patroncards/edit-template.pl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt index f92069a124..bc316d9390 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt @@ -96,7 +96,7 @@ [% FOREACH text_field IN table_loo.text_fields %] [% IF ( text_field.select_field ) %] - Edit + Edit [% IF ( print ) %] Export [% END %] diff --git a/patroncards/edit-layout.pl b/patroncards/edit-layout.pl index 544ee4421e..2bc9d1ea9b 100755 --- a/patroncards/edit-layout.pl +++ b/patroncards/edit-layout.pl @@ -80,7 +80,7 @@ sub _set_selected { return \@select_list; } -if ($op eq 'cud-edit') { +if ($op eq 'edit_form') { warn sprintf("Error performing '%s': No 'layout_id' passed in.", $op) unless ($layout_id); $layout = C4::Patroncards::Layout->retrieve(layout_id => $layout_id); $layout_xml = XMLin($layout->get_attr('layout_xml'), ForceArray => 1); diff --git a/patroncards/edit-profile.pl b/patroncards/edit-profile.pl index 49dd334bf6..a41529c1b4 100755 --- a/patroncards/edit-profile.pl +++ b/patroncards/edit-profile.pl @@ -45,7 +45,7 @@ my @label_template = (); my $units = get_unit_values(); -if ($op eq 'cud-edit') { # FIXME This looks like edit_form ? +if ($op eq 'edit_form') { # FIXME This looks like edit_form ? $profile = C4::Patroncards::Profile->retrieve(profile_id => $profile_id); $template_list = get_all_templates({ fields => [ qw( template_id template_code profile_id ) ] }); } diff --git a/patroncards/edit-template.pl b/patroncards/edit-template.pl index dacb4f3366..76901412d7 100755 --- a/patroncards/edit-template.pl +++ b/patroncards/edit-template.pl @@ -45,7 +45,7 @@ my $profile_list = undef; my $units = get_unit_values(); -if ($op eq 'cud-edit') { # FIXME This looks like edit_form +if ($op eq 'edit_form') { # FIXME This looks like edit_form $card_template = C4::Patroncards::Template->retrieve(template_id => $template_id); $profile_list = get_all_profiles({ fields => [ qw( profile_id printer_name paper_bin ) ], filters => {template_id => [ $template_id, 0 ], creator => 'Patroncards'} } ); } -- 2.30.2