From da9371a1d6a257d6d598c9299a33aedff183fc4c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Fri, 10 Mar 2017 11:22:24 +0100 Subject: [PATCH] Bug 18244: Patron card creator does not take in account fields with underscore (B_address etc.) Fields with underscore like B_address do not print on patron cards. To reproduce: - Create patron card layout using fields with underscore in their name (e.g. ) - Print (export) patron card - Verify that fields without underscore are replaced by their value, but fields with underscore do not replace but show the field name To test: - Apply patch - Try to reproduce and verify that fields with underscore are replace as expected Signed-off-by: Christopher Brannon Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit a723de2ae0c393743fc111955ee81b5e6c5b7f4a) Signed-off-by: Katrin Fischer --- C4/Patroncards/Patroncard.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Patroncards/Patroncard.pm b/C4/Patroncards/Patroncard.pm index 2203d1a1e5..7678ac0d2a 100644 --- a/C4/Patroncards/Patroncard.pm +++ b/C4/Patroncards/Patroncard.pm @@ -89,15 +89,15 @@ sub draw_text { my $line = shift @$text; my $parse_line = $line; my @orig_line = split(/ /,$line); - if ($parse_line =~ m/<[A-Za-z0-9]+>/) { # test to see if the line has db fields embedded... + if ($parse_line =~ m/<[A-Za-z0-9_]+>/) { # test to see if the line has db fields embedded... my @fields = (); - while ($parse_line =~ m/<([A-Za-z0-9]+)>(.*$)/) { + while ($parse_line =~ m/<([A-Za-z0-9_]+)>(.*$)/) { push (@fields, $1); $parse_line = $2; } my $borrower_attributes = get_borrower_attributes($self->{'borrower_number'},@fields); grep{ # substitute data for db fields - if ($_ =~ m/<([A-Za-z0-9]+)>/) { + if ($_ =~ m/<([A-Za-z0-9_]+)>/) { my $field = $1; $_ =~ s/$_/$borrower_attributes->{$field}/; } -- 2.39.5