[Koha-bugs] [Bug 29906] When changing hold parameters over API (PUT) it forcibly gets to "suspended" state

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jan 27 16:28:49 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29906

Jonathan Druart <jonathan.druart+koha at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #129663|0                           |1
        is obsolete|                            |
 Attachment #129666|0                           |1
        is obsolete|                            |

--- Comment #19 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
Created attachment 129898
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129898&action=edit
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 at ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list