Bug 17970: Fix GetPreparedLetter behavior if nothing to substitute
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Sat, 21 Jan 2017 13:13:49 +0000 (14:13 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 31 Mar 2017 11:10:57 +0000 (11:10 +0000)
commitd3cb1b0ab33b7070924611fd33e3a1aa3c34aab9
tree0d33af26e21842737541d8aaa7a3e02a6bde845b
parent52d5519743b2108cd01fcce9b9786a3e461f8e76
Bug 17970: Fix GetPreparedLetter behavior if nothing to substitute

From C4::Letters::GetPreparedLetter:

    my $tables = $params{tables};
    my $substitute = $params{substitute};

    $tables || $substitute || $repeat
       or carp( "ERROR: nothing to substitute - both 'tables' and 'substitute' are empty" ),
          return;

So if the parameter tables or substitute is passed but does not contain anything, it will not warn as expected.

Test plan:
1/ Apply the patch with tests
2/ Confirm that they do not pass
3/ Apply this patch
4/ Confirm that the tests now pass

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Letters.pm