Bug 43168: Check if there are errors, not if variable defined
$errors is an array ref returned from a blank array variable
if( $errors ){ #this will be true
if( scalar @$errors ){ #only true when array has members
To test:
1 - tail -f /var/log/koha/kohadev/intranet-error.log
2 - Stage a marc file
3 - Note the error:
==> /var/log/koha/kohadev/intranet-error.log <==
[2026/07/23 19:11:37] [WARN] The following error(s) occurred during ISO2709 record import:
ERROR: Koha::ImportBatch::try {...} /kohadevbox/koha/Koha/ImportBatch.pm (105)
4 - Apply patch
5 - Restart all
6 - Stage a file
7 - No error!
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
8dda84df37
commit
c277de2e70
|
|
@ -102,7 +102,7 @@ sub new_from_file {
|
|||
);
|
||||
}
|
||||
|
||||
if ($errors) {
|
||||
if ( scalar @$errors ) {
|
||||
Koha::Logger->get->warn( 'The following error(s) occurred during '
|
||||
. ( defined $format ? ( $format . " " ) : "" )
|
||||
. "record import:\nERROR: "
|
||||
|
|
|
|||
Loading…
Reference in New Issue