]> git.koha-community.org Git - koha.git/commit
Bug 17246: Do no support arrayref to define multiple FK
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 5 Sep 2016 08:54:35 +0000 (09:54 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Wed, 28 Dec 2016 13:32:10 +0000 (13:32 +0000)
commitea7bd9c4ada6eb6f03d37e43cce89d1431293761
tree97ee9836c34d244fe48dec07ac084f9931bb285e
parent0747a11b2648a20fcca9d3f5e02a4b3b9270b3f3
Bug 17246: Do no support arrayref to define multiple FK

Currently you can call GetPreparedLetter like:

$prepared_letter = GetPreparedLetter(
    (
        module      => 'test',
        letter_code => 'TEST_HOLD',
        tables      => {
            reserves => [ $fk1, $fk2 ],
        },
    )
);

It assumes that $fk1 is a borrowernumber and $fk2 a biblionumber.
It seems hazardous to do this guess.

I suggest to remove this feature and only allow hashref indeed.

Test plan:
Use different way to generate letters and make sure you do not reach the croak

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Letters.pm
t/db_dependent/Letters/TemplateToolkit.t