[Koha-bugs] [Bug 29906] New: 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
Wed Jan 19 16:55:46 CET 2022


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

            Bug ID: 29906
           Summary: When changing hold parameters over API (PUT) it
                    forcibly gets to "suspended" state
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Hold requests
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: stalkernoid at gmail.com
        QA Contact: testopia at bugs.koha-community.org
                CC: gmcharlt at gmail.com

This change:
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127244&action=diff

-        my $suspended_until   = exists $body->{suspended_until} ?
$body->{suspended_until} : $hold->suspend_until;

+        my $suspended_until =
+          exists $body->{suspended_until}
+          ? dt_from_string( $body->{suspended_until}, 'rfc3339' )
+          : dt_from_string( $hold->suspend_until,     'iso' );

Breaks passing "undef" in $hold->suspend_until
as well as "undef" in $body->{suspended_until}
to:

        my $params = {
            ... 
            suspend_until => $suspended_until

and always comes with date, it has "today date" instead of "udef" because:

sub dt_from_string  has:

    return DateTime->now( time_zone => $tz ) unless $date_string;


so as a result when you are changing any hold location (for example) from API,
it also puts that hold to be suspended.

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


More information about the Koha-bugs mailing list