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)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 14 May 2018 14:41:49 +0000 (14:41 +0000)
commitf5be2d525f7540a4833c14759bdc0de2ba5657db
tree37e6d7b756c802e4b9d3e724b906f80450829764
parent149645534bac47f8d0b9e63e7a9b53fc51f40076
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