From faec391e15a464591d16e78f0f45b449f328e081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?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. --- 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 ccbb973..2620816 100644 --- a/C4/Creators/Lib.pm +++ b/C4/Creators/Lib.pm @@ -559,7 +559,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++; -- 1.7.10.4