Bug 29789: Remove unused $error from cataloguing/additem.pl

my $error        = $input->param('error');

It should be removed as $error is used later but not related to this variable.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit b85e3cb811)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2022-01-04 15:40:19 +01:00 committed by Andrew Fuerste-Henry
parent 15137f36c0
commit 6f9c968ccc
1 changed files with 2 additions and 3 deletions

View File

@ -390,7 +390,6 @@ sub removeFieldsForPrefill {
}
my $input = CGI->new;
my $error = $input->param('error');
my $biblionumber;
my $itemnumber;
@ -695,7 +694,7 @@ if ($op eq "additem") {
#-------------------------------------------------------------------------------
# check that there is no issue on this item before deletion.
my $item = Koha::Items->find($itemnumber);
$error = $item->safe_delete;
my $error = $item->safe_delete;
if(ref($error) eq 'Koha::Item'){
print $input->redirect("additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&searchid=$searchid");
}else{
@ -707,7 +706,7 @@ if ($op eq "additem") {
#-------------------------------------------------------------------------------
my $items = Koha::Items->search({ biblionumber => $biblionumber });
while ( my $item = $items->next ) {
$error = $item->safe_delete({ skip_record_index => 1 });
my $error = $item->safe_delete({ skip_record_index => 1 });
next if ref $error eq 'Koha::Item'; # Deleted item is returned if deletion successful
push @errors,$error;
}