From bc7224c20c2298a86ccaad7098413aee7fb1f42c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 27 Aug 2014 14:16:39 +0200 Subject: [PATCH] Bug 12830: use find instead of search Since ordernumber is the pk, it is stupid to use search. Signed-off-by: Paola Rossi Signed-off-by: Katrin Fischer All acquisition related tests and the QA script pass. I can't find any regressions with these patches. Signed-off-by: Tomas Cohen Arazi --- Koha/Acquisition/Order.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm index d6cfa8e7ad..67a998210e 100644 --- a/Koha/Acquisition/Order.pm +++ b/Koha/Acquisition/Order.pm @@ -17,11 +17,10 @@ sub fetch { return unless $ordernumber; my $schema = Koha::Database->new->schema; - my $rs = - $schema->resultset('Aqorder')->search( { ordernumber => $ordernumber }, + my $order = + $schema->resultset('Aqorder')->find( { ordernumber => $ordernumber }, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' } ); - - return $class->new( $rs->first ); + return $class->new( $order ); } sub insert { -- 2.39.5