From 381dd46c36260f20a18b054bff142ea9eb519f3a Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Thu, 25 Aug 2016 16:08:45 +0200 Subject: [PATCH] Bug 7677: QA followup Fix 'unique contraint primary' error when receiving serials Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- Koha/Serial/Item.pm | 2 +- serials/serials-edit.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Serial/Item.pm b/Koha/Serial/Item.pm index 3509b3deb3..c3286a5323 100644 --- a/Koha/Serial/Item.pm +++ b/Koha/Serial/Item.pm @@ -39,7 +39,7 @@ Koha::Serial::Item - Koha Serial Item Object class =cut -sub type { +sub _type { return 'Serialitem'; } diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index 12efa67930..2bff94b66e 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -257,7 +257,7 @@ if ( $op and $op eq 'serialchangestatus' ) { my $previous = GetPreviousSerialid($subscriptionids[$i]); if ($previous) { - my $serialitem = Koha::Serial::Items->find( $previous ); + my $serialitem = Koha::Serial::Items->search( {serialid => $previous} )->next; my $itemnumber = $serialitem ? $serialitem->itemnumber : undef; if ($itemnumber) { -- 2.39.5