Bug 20305: Remove warnings from tools scripts
[koha.git] / tools / batchMod.pl
index 0ab4db7..f24b2f6 100755 (executable)
@@ -19,8 +19,7 @@
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use CGI qw ( -utf8 );
-use strict;
-#use warnings; FIXME - Bug 2505
+use Modern::Perl;
 use C4::Auth;
 use C4::Output;
 use C4::Biblio;
@@ -208,7 +207,7 @@ if ($op eq "action") {
                 if ( $modified ) {
                     eval {
                         if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) {
-                            LostItem($itemnumber) if $item->{itemlost} and not $itemdata->{itemlost};
+                            LostItem($itemnumber, 'batchmod') if $item->{itemlost} and not $itemdata->{itemlost};
                         }
                     };
                 }
@@ -243,6 +242,7 @@ if ($op eq "show"){
             push @contentlist, $content if $content;
         }
 
+        @contentlist = uniq @contentlist;
         if ($filecontent eq 'barcode_file') {
             foreach my $barcode (@contentlist) {
 
@@ -316,7 +316,7 @@ my $pref_itemcallnumber = C4::Context->preference('itemcallnumber');
 my $subfieldsToAllowForBatchmod = C4::Context->preference('SubfieldsToAllowForRestrictedBatchmod');
 my $allowAllSubfields = (
     not defined $subfieldsToAllowForBatchmod
-      or $subfieldsToAllowForBatchmod == q||
+      or $subfieldsToAllowForBatchmod eq q||
 ) ? 1 : 0;
 my @subfieldsToAllow = split(/ /, $subfieldsToAllowForBatchmod);