Bug 27526: Fix for prefill preventing duplication 2

Prefill feature should not be in the priority
when user choose "Duplicate" for the item

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Andrew Nugged 2021-10-28 00:22:28 +03:00 committed by Jonathan Druart
parent fd29c73a38
commit 1fa2afe44b

View file

@ -565,7 +565,7 @@ my $branchcode = $input->param('branch') || C4::Context->userenv->{branch};
# OR
# If the subfield must be prefilled with last catalogued item
my @subfields_to_prefill;
if ( $nextop eq 'additem' && $prefillitem ) {
if ( $nextop eq 'additem' && $op ne 'dupeitem' && $prefillitem ) {
@subfields_to_prefill = split(' ', C4::Context->preference('SubfieldsToUseWhenPrefill'));
# Setting to 1 element if SubfieldsToUseWhenPrefill is empty to prevent all the subfields to be prefilled
@subfields_to_prefill = ("") unless @subfields_to_prefill;