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)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 22 May 2018 10:34:45 +0000 (12:34 +0200)
commit4276a5fdc216e877130dbf5b1d46f1cf2e2f166a
treea6c05a1f3b51305ebed7c47d33f863ea5f3d5a05
parent3a803fe5319fb29edfbe54c20be52f8fc4a34161
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>
(cherry picked from commit f5be2d525f7540a4833c14759bdc0de2ba5657db)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Letters.pm
Koha/Template/Plugin/Remove_MARC_punctuation.pm [new file with mode: 0644]
t/db_dependent/Letters/TemplateToolkit.t