Bug 27526: Fix for prefill preventing duplication

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Andrew Nugged 2021-10-16 00:16:35 +03:00 committed by Jonathan Druart
parent 46394b0021
commit 6ae81043b7

View file

@ -819,7 +819,8 @@ for my $library ( @$libraries ) {
# Using last created item if it exists
if ( $prefillitem
&& $op ne "additem"
&& $op ne "edititem" )
&& $op ne "edititem"
&& $op ne "dupeitem" )
{
my $item_from_cookie = get_item_from_cookie($input);
$current_item = $item_from_cookie if $item_from_cookie;
@ -852,6 +853,7 @@ foreach my $tag ( keys %{$tagslib} ) {
# If the subfield must be prefilled with last catalogued item
if (
$nextop ne 'additem'
|| $op eq 'dupeitem'
|| (
!$prefillitem
|| ( $prefillitem && grep { $_ eq $subtag }