Bug 36976: Warning 'Argument "" isn't numeric in numeric' in log when merging bibliographic records

When merging bibliographic records, Koha generates warning:

[WARN] Argument "" isn't numeric in numeric ge (>=) at /kohadevbox/koha/Koha/Util/MARC.pm line 81.

in [plack-]intranet-error.log.

This is because $tagslib->{$fieldtag}->{'tab'} -- for a tag, not for a
subfield --is (always?) an empty string (cf.
C4::Biblio::GetMarcStructure : $res->{$tag}->{tab} = ""), and in
Koha::Util::MARC::createMergeHash it is compared numerically with 0.

Test plan:
==========
1. From biblio search result page, selact two records with the checkboxes
   and start a merge (Edit -> Merge records).  Proceed with merging.
   After the merge, controll the content of the plack-intranet-error.log
   (when using plack -- standard in ktd).  Note the lines:
   [WARN] Argument "" isn't numeric in numeric ge (>=) at /kohadevbox/koha/Koha/Util/MARC.pm line 81.
2. Apply the patch; restart_all.
3. Repeat p. 1.  There should be no fresh warnings.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fb2e54b0c3)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Janusz Kaczmarek 2024-05-28 12:42:20 +00:00 committed by Lucas Gass
parent 15c7c419e0
commit 6e66ea7151
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ sub createMergeHash {
(
!defined($tagslib) || ( defined $tagslib->{$fieldtag}
&& defined $tagslib->{$fieldtag}->{'tab'}
&& $tagslib->{$fieldtag}->{'tab'} >= 0 )
&& ( $tagslib->{$fieldtag}->{'tab'} ? $tagslib->{$fieldtag}->{'tab'} : 0 ) >= 0 )
)
&& @subfield_array
)