https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32563
Emmi Takkinen <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #4 from Emmi Takkinen <[email protected]> --- (In reply to Anneli Österman from comment #3) > I tested this in PTFS-Europe's sandbox and noticed that if > DefaultHoldExpirationdate is set and I trap a hold and revert the hold's > waiting status and then try to cancel the hold, I get an error. > > {UNKNOWN}: Can't locate object method "clone" via package "2023-01-27" > (perhaps you forgot to load "2023-01-27"?) at /kohadevbox/koha/Koha/Hold.pm > line 898. at /kohadevbox/koha/Koha/Hold.pm line 762 > at /usr/share/perl5/DBIx/Class/Exception.pm line 77 > > The hold's expirationdate should have been set back to the original > expirationdate but it becomes empty. When I check reserves table the hold > does not have expirationdate or patron_expiration_date set. This happens because reservedate fetched from database is not a DateTime object. Instead cloning $self->reservedate we should use dt_from_string to $self->reservedate and then clone. Then use that clone with add. Something like this: >my $reservedate = dt_from_string( $self->reservedate ); >my $reservedate_clone = $reservedate->clone; >$self->expirationdate( >$reservedate_clone->add( $timeunit => $period ) ); -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
