]> git.koha-community.org Git - koha.git/commit
Bug 29906: fix when hold record forcibly gets unwanted "suspended" state
authorPetro Vashchuk <stalkernoid@gmail.com>
Wed, 19 Jan 2022 16:01:15 +0000 (18:01 +0200)
committerKyle Hall <kyle@bywatersolutions.com>
Mon, 7 Feb 2022 16:40:17 +0000 (11:40 -0500)
commita549d30a3c1e7ffb19d552773d5e8c63a0e11dae
treee044b535db6ad5cc697599ddd060713361609db4
parent27ec3a5d4c2b8bc304d23197563952ef47d5986a
Bug 29906: fix when hold record forcibly gets unwanted "suspended" state

This code allows for "Perl false" to pass through to $suspended_until
if it is in $hold->suspend_until and in $body->{suspended_until}
But in case of "Perl truth" it calls dt_from_string for that value.

Reproduction:
1. run provided test in kshell: prove t/db_dependent/api/v1/holds.t
2. see the test fails with something like:
    #   Failed test 'Location change shouldn't touch suspended status'
    #   at t/db_dependent/api/v1/holds.t line 1067.
    #          got: '1'
    #     expected: '0'

    #   Failed test 'suspended_until should be undef'
    #   at t/db_dependent/api/v1/holds.t line 1068.
    #          got: '2022-01-20 00:00:00'
    #     expected: undef
    # Looks like you failed 2 tests of 39.
3. apply the changes in this patch to Koha/REST/V1/Holds.pm
4. run provided test in kshell: prove t/db_dependent/api/v1/holds.t
5. test will pass.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/REST/V1/Holds.pm
t/db_dependent/api/v1/holds.t