From f22f9e408045a8edb4b8b55876ab7f395f5360cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Cohen=20Arazi?= Date: Tue, 30 Sep 2025 19:26:43 -0300 Subject: [PATCH] Bug 40919: Remove unnecessary DB call in Koha::Item::Transfer->receive This patch removes a trivially not required DB object instantiation. This implies saving CPU usage for the instantiation and algo for fetching from the DB. To test: 1. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Item/Transfer.t => SUCCESS: Tests pass! They cover ->receive() 2. Apply this patch 3. Repeat 1 => SUCCESS: No behavior change, tests pass! 4. Sign off :-D Signed-off-by: Martin Renvoize --- Koha/Item/Transfer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Item/Transfer.pm b/Koha/Item/Transfer.pm index 1abc0767c25..f59a51d747b 100644 --- a/Koha/Item/Transfer.pm +++ b/Koha/Item/Transfer.pm @@ -175,7 +175,7 @@ sub receive { # Update the arrived date $self->set( { datearrived => dt_from_string } )->store; - ModDateLastSeen( $self->item->itemnumber ); + ModDateLastSeen( $self->itemnumber ); return $self; } -- 2.51.1