Bug 35405 - MarcAuthorities: Use of uninitialized value $tag in hash element at MARC/Record.pm line 202.
Summary: MarcAuthorities: Use of uninitialized value $tag in hash element at MARC/Reco...
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 25790
  Show dependency treegraph
 
Reported: 2023-11-27 15:05 UTC by Marcel de Rooy
Modified: 2024-01-04 20:28 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.02,23.05.08


Attachments
Bug 35405: Remove noise from MARC::Record in SearchAuthorities (1.87 KB, patch)
2023-11-27 15:23 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 35405: Remove noise from MARC::Record in SearchAuthorities (1.87 KB, patch)
2023-11-29 10:09 UTC, David Nind
Details | Diff | Splinter Review
Bug 35405: Remove noise from MARC::Record in SearchAuthorities (1.93 KB, patch)
2023-12-18 11:39 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2023-11-27 15:05:05 UTC
When calling SearchAuthorities, there can be a lot of noise from MARC::Record.

For each hit:
Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202.
Comment 1 Marcel de Rooy 2023-11-27 15:23:50 UTC
Created attachment 159274 [details] [review]
Bug 35405: Remove noise from MARC::Record in SearchAuthorities

We are calling ->field with an undef parameter.
MARC::Record does not like that and says:
  Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202.
For now, a fix at our side.

Test plan:
Run SearchAuthorities without passing an authtypecode.
Without this patch, it results in a warning per hit.
With this patch, the noise should be gone.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 David Nind 2023-11-29 10:09:36 UTC
Created attachment 159322 [details] [review]
Bug 35405: Remove noise from MARC::Record in SearchAuthorities

We are calling ->field with an undef parameter.
MARC::Record does not like that and says:
  Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202.
For now, a fix at our side.

Test plan:
Run SearchAuthorities without passing an authtypecode.
Without this patch, it results in a warning per hit.
With this patch, the noise should be gone.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2023-11-29 10:18:38 UTC
Testing notes (using KTD):

1. Go to Authorities.
2. Using the search in the header bar, click on the arrow to perform a search.
3. Note that the warning "Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202." appears several times in the /var/log/koha/kohadev/plack-intranet-error.log file.
4. Perform another search, except change the Authority type search from "Default" to "Corporate Name" (using the little selector before the arrow).
5. Note that the warning message in step 3 is not recorded in the log file.
6. Apply the patch and restart_all
7. Repeat steps 2-5 - the warning in step 3 no longer appears.

Additional note: this warning message appears in the log file once for each search (whether or not the authority type is selected) "[WARN] Use of uninitialized value $q2 in concatenation (.) or string at /kohadevbox/koha/C4/AuthoritiesMarc.pm line 230.".
Comment 4 Tomás Cohen Arazi 2023-12-18 11:39:16 UTC
Created attachment 159948 [details] [review]
Bug 35405: Remove noise from MARC::Record in SearchAuthorities

We are calling ->field with an undef parameter.
MARC::Record does not like that and says:
  Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202.
For now, a fix at our side.

Test plan:
Run SearchAuthorities without passing an authtypecode.
Without this patch, it results in a warning per hit.
With this patch, the noise should be gone.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Katrin Fischer 2023-12-18 14:25:21 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 6 Fridolin Somers 2024-01-03 14:53:27 UTC
Pushed to 23.11.x for 23.11.02
Comment 7 Lucas Gass 2024-01-04 20:28:52 UTC
Backported to 23.05.x for upcoming 23.05.08