Bug 19578: Remove MARC punctuation in notices (TT syntax)
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 6 Nov 2017 18:35:50 +0000 (15:35 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 4 Apr 2018 18:45:43 +0000 (15:45 -0300)
commitb1f2c84e5078c2aa77e428ca359aef4df952944a
tree04f2ada33fd4d99ed874910c85af1d628429e024
parent9a76781f9ef0ba997fdaf79d78648a6c41827f03
Bug 19578: Remove MARC punctuation in notices (TT syntax)

Jenkins fails (run 287) on a test in t/db_dependent/Letters/TemplateToolkit.t:

With the historical syntax:
        # Your request for an article from tQYRS (c3Av58O0P5xkkIGu) has been canceled for the following reason:

With the TT syntax:
        # Your request for an article from tQYRS_ (c3Av58O0P5xkkIGu) has been canceled for the following reason:

The last character of the biblio's title has been removed because it's a punctuation character.
It comes from: C4::Letters::_parseletter
 893         $val =~ s/\p{P}$// if $val && $table=~/biblio/;

The same replacement is done for patron's attributes too.

Test plan:
- Confirm that the new tests pass. That should be enough to confirm this change make sense.

Test plan (manual):
- Create a biblio with a title ending with a punctuation (like "with_punctuation_"), or any other fields of biblio/biblioitem
- Generate a notice which will display this field (CHECKIN for instance)

Use the historical syntax and the TT syntax, both should display the title without the punctuation character at the end

CHECKIN historical:
The following items have been checked in:
----
<<biblio.title>>
----

CHECKIN TT syntax:
The following items have been checked in:
----
[% biblio.title %]
----

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Letters.pm
Koha/Template/Plugin/Remove_MARC_punctuation.pm [new file with mode: 0644]
t/db_dependent/Letters/TemplateToolkit.t