Bug 31212: Fix date_from_string and explicitly called output_pref subroutine

Signed-off-by: Ann Flournoy <aflournoy@cityofkeller.com>

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Lucas Gass 2022-10-20 16:29:36 +00:00 committed by Tomas Cohen Arazi
parent 2c19382503
commit 8b02cfe94b
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 4 additions and 4 deletions

View File

@ -42,7 +42,7 @@ use Koha::Account;
use Koha::AuthorisedValues;
use Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue;
use Koha::Biblioitems;
use Koha::DateUtils qw( dt_from_string );
use Koha::DateUtils qw( dt_from_string output_pref );
use Koha::Calendar;
use Koha::Checkouts;
use Koha::Illrequests;
@ -1695,7 +1695,7 @@ sub AddIssue {
$item_object->itemlost(0);
$item_object->onloan($datedue->ymd());
$item_object->datelastborrowed( dt_from_string()->ymd() );
$item_object->datelastseen( dt_from_string()->ymd() );
$item_object->datelastseen( dt_from_string() );
$item_object->store( { log_action => 0, skip_holds_queue => 1 } );
# If the item was lost, it has now been found, charge the overdue if necessary

View File

@ -56,7 +56,7 @@ use DateTime::Format::MySQL;
# debugging; so please don't remove this
use Koha::AuthorisedValues;
use Koha::DateUtils qw( dt_from_string );
use Koha::DateUtils qw( dt_from_string output_pref );
use Koha::Database;
use Koha::Biblios;
@ -406,7 +406,7 @@ sub ModDateLastSeen {
my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 0 });
my $item = Koha::Items->find($itemnumber);
$item->datelastseen(dt_from_string->ymd);
$item->datelastseen(dt_from_string);
my $log = $item->itemlost && !$leave_item_lost ? 1 : 0; # If item was lost, record the change to the item
$item->itemlost(0) unless $leave_item_lost;
$item->store({ log_action => $log, skip_record_index => $params->{skip_record_index}, skip_holds_queue => $params->{skip_holds_queue} });