From 6b5c632d9e254aac419b0576508ea6296b7b03a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Mon, 4 May 2015 23:29:29 +0200 Subject: [PATCH] Bug 14143 - Patron cards: Crash (confusion between table names creator_templates and club_template_enrollment_fields) To reproduce: Go to Home > Tools > Patron card creator Click on 'Manage profiles' Result: Can't use string ("1") as an ARRAY ref while "strict refs" in use at /usr/share/kohaclone/C4/Creators/Lib.pm line 564. Reason: Select statment to get field 'template code' from table 'club_template_enrollment_fields' (!) instead of 'table creator_templates'. To test: Apply patch Try to reproduce issue. Amended because of typo (_ instead of -) Signed-off-by: Kyle M Hall --- C4/Creators/Lib.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Creators/Lib.pm b/C4/Creators/Lib.pm index eb97bc1156..3c53498d1a 100644 --- a/C4/Creators/Lib.pm +++ b/C4/Creators/Lib.pm @@ -556,7 +556,7 @@ sub html_table { next POPULATE_ROW; } elsif ($table_column =~ m/^_((.*)_(.*$))/) { # this a special case - my $table_name = get_table_names($2); + my $table_name = get_table_names('creator_'.$2); #Bug 14143 fix to remove ambiguity with table 'club_template_enrollment_fields' my $record_set = _SELECT($1, @$table_name[0], $2 . "_id = " . $db_row->{$2 . "_id"}); $$fields[$col_index] = {hidden => 0, link_field => $link_field->{$table_column}, select_field => 0, field_name => ($table_column . "_tbl"), field_value => $$record_set[0]{$1}}; $col_index++; -- 2.39.5