Bug 21172 - Warning in addbiblio.pl - Argument "01e" isn't numeric in numeric ne (!=)
Summary: Warning in addbiblio.pl - Argument "01e" isn't numeric in numeric ne (!=)
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-07 20:06 UTC by Jonathan Druart
Modified: 2020-11-30 21:44 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.05


Attachments
Bug 21172: Remove warning from addbiblio.pl (1.79 KB, patch)
2018-08-07 20:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21172: Remove warning from addbiblio.pl (1.84 KB, patch)
2019-04-16 17:08 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 21172: Remove warning from addbiblio.pl (1.89 KB, patch)
2019-04-16 21:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21172: Remove obsolete framework parameter from GetMarcFromKohaField (933 bytes, patch)
2019-04-16 21:04 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2018-08-07 20:06:36 UTC
Argument "01e" isn't numeric in numeric ne (!=) at /home/vagrant/kohaclone/cataloguing/addbiblio.pl line 507.
Comment 1 Jonathan Druart 2018-08-07 20:11:38 UTC
Created attachment 77544 [details] [review]
Bug 21172: Remove warning from addbiblio.pl

Argument "01e" isn't numeric in numeric ne (!=) at
/home/vagrant/kohaclone/cataloguing/addbiblio.pl line 507.

A tagfield can be 01e and so raise a warning is compared with == or !=

This patch also fixes few inconsistencies:
- tagfield for items.itemnumber must be retrieved with GetMarcFromKohaField
(to support other marcflavours)
- do not use $_
- loop only once on $usedTagsLib

Test plan:
For devs only, read the code and confirm the changes make sense.
Comment 2 Tomás Cohen Arazi 2018-08-24 15:12:40 UTC
Isn't 01e a bug on the data?
Comment 3 Jonathan Druart 2018-08-24 20:26:02 UTC
(In reply to Tomás Cohen Arazi from comment #2)
> Isn't 01e a bug on the data?

Maybe, maybe not, who really knows? :)

"01e" site:http://irc.koha-community.org
will return stuffs like:

09:55 magnusenger Is it just me, or does a MARC21 tag called 01e look a little odd?

10:02 	drojf 	oh that 01e coded field error thing in the marc frameworks is actually supposed to be there? i always thought that was a misspelled 019 :D

11:09 	gmcharlt 	magnusenger: it's not standard MARC21; it's a custom field that was once used by the RLIN bibliographic utlity

18:46 tcohen            i've just noticed we don't have it, but have '01e' instead
18:46 tcohen            is field 019 of any use in MARC21?

Then:
http://irc.koha-community.org/koha/2013-07-16
http://irc.koha-community.org/koha/2012-11-21

etc.
Comment 4 David Cook 2019-01-23 06:20:27 UTC
(In reply to Tomás Cohen Arazi from comment #2)
> Isn't 01e a bug on the data?

I was curious about this...

https://www.loc.gov/marc/bibliographic/bdintro.html

"Variable fields - The data in a MARC bibliographic record is organized into variable fields, each identified by a three-character numeric tag that is stored in the Directory entry for the field. Each field ends with a field terminator character. The last variable field in a record ends with both a field terminator and a record terminator (ASCII 1D hex). There are two types of variable fields."

It seems that technically 01e is a violation of the MARC standard. 

Maybe it is time to remove 01e from the frameworks...
Comment 5 Liz Rea 2019-04-16 17:08:26 UTC
Created attachment 88092 [details] [review]
Bug 21172: Remove warning from addbiblio.pl

Argument "01e" isn't numeric in numeric ne (!=) at
/home/vagrant/kohaclone/cataloguing/addbiblio.pl line 507.

A tagfield can be 01e and so raise a warning is compared with == or !=

This patch also fixes few inconsistencies:
- tagfield for items.itemnumber must be retrieved with GetMarcFromKohaField
(to support other marcflavours)
- do not use $_
- loop only once on $usedTagsLib

Test plan:
For devs only, read the code and confirm the changes make sense.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 6 Josef Moravec 2019-04-16 18:33:14 UTC
Comment on attachment 88092 [details] [review]
Bug 21172: Remove warning from addbiblio.pl

Review of attachment 88092 [details] [review]:
-----------------------------------------------------------------

::: cataloguing/addbiblio.pl
@@ +490,5 @@
>      my %seen;
>      my @tab_data; # all tags to display
> +
> +    my $max_num_tab=-1;
> +    my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber", scalar $input->param('frameworkcode') );

Second param is not needed, now the default framework is taken as authoritative for marc to koha mappings.
Comment 7 Josef Moravec 2019-04-16 18:34:36 UTC
Otherwise looking good for me, marc21 standard does not allow non numeric tags, but sometimes it happens and Koha should count with this
Comment 8 Katrin Fischer 2019-04-16 21:04:17 UTC
Created attachment 88117 [details] [review]
Bug 21172: Remove warning from addbiblio.pl

Argument "01e" isn't numeric in numeric ne (!=) at
/home/vagrant/kohaclone/cataloguing/addbiblio.pl line 507.

A tagfield can be 01e and so raise a warning is compared with == or !=

This patch also fixes few inconsistencies:
- tagfield for items.itemnumber must be retrieved with GetMarcFromKohaField
(to support other marcflavours)
- do not use $_
- loop only once on $usedTagsLib

Test plan:
For devs only, read the code and confirm the changes make sense.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Katrin Fischer 2019-04-16 21:04:20 UTC
Created attachment 88118 [details] [review]
Bug 21172: Remove obsolete framework parameter from GetMarcFromKohaField
Comment 10 Katrin Fischer 2019-04-16 21:05:12 UTC
Happy to see this old warning go away.
I provided a follow-up to fix Josef's concern. I noticed there are still a lot of calls with the framework parameter even if it has no effect. Something to fix separately at some point.
Comment 11 Nick Clemens 2019-04-17 12:26:57 UTC
Awesome work all!

Pushed to master for 19.05
Comment 12 Martin Renvoize 2019-04-26 11:57:46 UTC
Pushed to 18.11.x for 18.11.05
Comment 13 Lucas Gass 2019-05-10 21:00:03 UTC
backported to 18.05.x for 18.05.13
Comment 14 Marcel de Rooy 2019-12-19 10:41:32 UTC
(In reply to David Cook from comment #4)
> It seems that technically 01e is a violation of the MARC standard. 
> 
> Maybe it is time to remove 01e from the frameworks...

See bug 24274