From: Kyle M Hall Date: Tue, 21 Oct 2014 10:18:29 +0000 (-0400) Subject: Bug 13124 - Record titles with parentheses causing label weirdness X-Git-Tag: v3.20.00-beta~876 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=fe4da2f721c371540fe88d0014a49a866b403ca4;p=koha-ffzg.git Bug 13124 - Record titles with parentheses causing label weirdness Test Plan ( using sample data included with Koha ) 1) Catalog a record and item with the title "Oh no! or, (How my science project destroyed the world) /" 2) Edit the DEFAULT template a) Set layout type to Biblio b) Set data fields to "title, author, isbn, issn, itemtype, barcode, itemcallnumber" c) Set font size to 10 3) Create a batch with just the one item you created 4) Export the PDF with the Avery template and the DEFAULT layout 5) Note the weirdness 6) Apply this patch 7) Re-export the PDF, note it's no longer weird ; ) Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- diff --git a/C4/Labels/Label.pm b/C4/Labels/Label.pm index ff6c8654e5..bd3ee4fe7b 100644 --- a/C4/Labels/Label.pm +++ b/C4/Labels/Label.pm @@ -424,8 +424,9 @@ sub draw_label_text { else { if ($field_data) { $field_data =~ s/\/$//g; # Here we will strip out all trailing '/' in fields other than the call number... - $field_data =~ s/\(/\\\(/g; # Escape '(' and ')' for the pdf object stream... - $field_data =~ s/\)/\\\)/g; + # Escaping the parens was causing odd output, see bug 13124 + # $field_data =~ s/\(/\\\(/g; # Escape '(' and ')' for the pdf object stream... + # $field_data =~ s/\)/\\\)/g; } eval{$Text::Wrap::columns = $self->{'text_wrap_cols'};}; my @line = split(/\n/ ,wrap('', '', $field_data));