http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9231

--- Comment #5 from Chris Cormack <[email protected]> ---
Comment on attachment 17910
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17910
Bug 9231 - Batch revert staged MARC records fails if one or more records in a
batch have been deleted.

Review of attachment 17910:
 --> 
(http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=9231&attachment=17910)
-----------------------------------------------------------------

::: C4/Items.pm
@@ +619,4 @@
>  
>      # backup the record
>      my $copy2deleted = $dbh->prepare("UPDATE deleteditems SET marc=? WHERE 
> itemnumber=?");
> +    eval { $copy2deleted->execute( $record->as_usmarc(), $itemnumber ); }; 
> warn $@ if $@;

If the error is caused by $record being undefined, wouldn't it be better to do

if ($record){
  my $copy2deleted = $dbh->prepare("UPDATE deleteditems SET marc=? WHERE
itemnumber=?");
  $copy2deleted->execute( $record->as_usmarc(), $itemnumber );
}

To save creating a handle and hitting the db when we don't need to, could even
do an
else {
  log deleted one here to tell the user
}

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to