diff --git a/Koha/UploadedFile.pm b/Koha/UploadedFile.pm index 009c333a8d..13ec2eaadb 100644 --- a/Koha/UploadedFile.pm +++ b/Koha/UploadedFile.pm @@ -78,8 +78,10 @@ sub delete { return $retval if $params->{keep_file}; if( ! -e $file ) { - warn "Removing record for $name within category ". - $self->uploadcategorycode. ", but file was missing."; + if ( $self->permanent ) { + warn "Removing record for $name within category ". + $self->uploadcategorycode. ", but file was missing."; + } } elsif( ! unlink($file) ) { warn "Problem while deleting: $file"; }