From 313b47c94e6397fc0ad0d8c0022941cd1cc3c476 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 23 Mar 2020 11:34:43 +0100 Subject: [PATCH] Bug 23463: Fix CourseReserves/CourseItems.t Signed-off-by: Martin Renvoize --- C4/CourseReserves.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/CourseReserves.pm b/C4/CourseReserves.pm index 3b9bbd45bc..18fa4a124b 100644 --- a/C4/CourseReserves.pm +++ b/C4/CourseReserves.pm @@ -588,10 +588,10 @@ sub _RevertFields { return unless ($ci_id); my $course_item = GetCourseItem( ci_id => $params{'ci_id'} ); - my $course_item_object; + my $course_item_object = Koha::Items->find($course_item->{'itemnumber'}); foreach my $field ( @FIELDS ) { next unless defined $course_item->{$field}; - $course_item->$field($course_item->{$field}); + $course_item_object->$field($course_item->{$field}); } $course_item_object->store; } -- 2.39.5