[Bug 41706] New: "Use of uninitialized value..." warning in C4/Record.pm
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Bug ID: 41706 Summary: "Use of uninitialized value..." warning in C4/Record.pm Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: roman.dolny@jezuici.pl QA Contact: testopia@bugs.koha-community.org The warning: [WARN] Use of uninitialized value $2 in split at /kohadevbox/koha/C4/Record.pm line 924. appears in the plack-opac-error.log file. To reproduce in KTD: 1. Observe plack-opac-error.log 2. In OPAC go to record with one word author like Aristophanes, Aristotle or Xenophon (biblionumbers: 64, 176, 254) 3. Show it in any of "detail" view (Normal, MARC, ISBD) 4. Warning appears in plack-opac-error.log It happens during the preparation of data for the "Cite" feature in OPAC. The warning appears because of the overlap of two regular expression matches - the variable captured from the first regular expression match is changed (by the second regular expression match) before it is used. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 --- Comment #1 from Roman Dolny <roman.dolny@jezuici.pl> --- Created attachment 192011 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192011&action=edit Bug 41706: "Use of uninitialized value..." warning in C4/Record.pm The warning: [WARN] Use of uninitialized value $2 in split at /kohadevbox/koha/C4/Record.pm line 924. appears in the plack-opac-error.log file. It happens during the preparation of data for the "Cite" feature in OPAC for some of author's fields. To test: ======== 1. Observe plack-opac-error.log. 2. In OPAC go to record with one word author like Aristophanes, Aristotle or Xenophon (biblionumbers: 64, 176, 254). 3. Show it in any of "detail" view (Normal, MARC, ISBD). 4. Warning appears in plack-opac-error.log. 5. Apply the patch; restart_all. 6. Repeat 2-3. Warning doesn't appear. Sponsored-by: Ignatianum University in Cracow -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Comma delimited| |Ignatianum University in list of Sponsors| |Cracow Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192011|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 192063 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192063&action=edit Bug 41706: "Use of uninitialized value..." warning in C4/Record.pm The warning: [WARN] Use of uninitialized value $2 in split at /kohadevbox/koha/C4/Record.pm line 924. appears in the plack-opac-error.log file. It happens during the preparation of data for the "Cite" feature in OPAC for some of author's fields. To test: ======== 1. Observe plack-opac-error.log. 2. In OPAC go to record with one word author like Aristophanes, Aristotle or Xenophon (biblionumbers: 64, 176, 254). 3. Show it in any of "detail" view (Normal, MARC, ISBD). 4. Warning appears in plack-opac-error.log. 5. Apply the patch; restart_all. 6. Repeat 2-3. Warning doesn't appear. Sponsored-by: Ignatianum University in Cracow Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |Removes the cause of release notes| |"[WARN] Use of | |uninitialized value $2 in | |split at | |/kohadevbox/koha/C4/Record. | |pm line 924." warnings from | |the plack-opac-error.log | |when viewing record detail | |pages in the OPAC. This was | |related to the Cite | |feature. CC| |david@davidnind.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |roman.dolny@jezuici.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |jonathan.druart@gmail.com |y.org | Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192063|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 200736 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200736&action=edit Bug 41706: "Use of uninitialized value..." warning in C4/Record.pm The warning: [WARN] Use of uninitialized value $2 in split at /kohadevbox/koha/C4/Record.pm line 924. appears in the plack-opac-error.log file. It happens during the preparation of data for the "Cite" feature in OPAC for some of author's fields. To test: ======== 1. Observe plack-opac-error.log. 2. In OPAC go to record with one word author like Aristophanes, Aristotle or Xenophon (biblionumbers: 64, 176, 254). 3. Show it in any of "detail" view (Normal, MARC, ISBD). 4. Warning appears in plack-opac-error.log. 5. Apply the patch; restart_all. 6. Repeat 2-3. Warning doesn't appear. Sponsored-by: Ignatianum University in Cracow Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 200737 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200737&action=edit Bug 41706: Add a test Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA CC| |pedro.amorim@openfifth.co.u | |k --- Comment #5 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Not a huge blocker but tests look weird? my $marc_record = MARC::Record->new(); This variable is never used. Can you please double-check. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200737|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 202724 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202724&action=edit Bug 41706: Add a test Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Amended: - $marc->append_fields( MARC::Field->new( '100', ' ', ' ', a => 'Aristotle.' ) ); - marc2cites($marc); + $marc_record->append_fields( MARC::Field->new( '100', ' ', ' ', a => 'Aristotle.' ) ); + marc2cites($marc_record); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 --- Comment #7 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Pedro Amorim (ammopt) from comment #5)
Not a huge blocker but tests look weird?
my $marc_record = MARC::Record->new();
This variable is never used. Can you please double-check.
Thanks, fixed now! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #8 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- (In reply to Jonathan Druart from comment #7)
Thanks, fixed now!
Hi Joubu, apologies, but the test passes before and after the fix patch. Should it not fail before the fix patch? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 --- Comment #9 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Pedro Amorim (ammopt) from comment #8)
(In reply to Jonathan Druart from comment #7)
Thanks, fixed now!
Hi Joubu, apologies, but the test passes before and after the fix patch. Should it not fail before the fix patch?
Please double-check, it fails for me without the fix: t/db_dependent/Record.t .. 1/18 # Failed test 'no warnings' # at /usr/share/perl/5.40/Test/Builder.pm line 193. # There were 1 warning(s) # Previous test 0 '' # Use of uninitialized value $2 in split at /kohadevbox/koha/C4/Record.pm line 924. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 --- Comment #10 from David Nind <david@davidnind.com> --- (In reply to Jonathan Druart from comment #9)
(In reply to Pedro Amorim (ammopt) from comment #8)
(In reply to Jonathan Druart from comment #7)
Thanks, fixed now!
Hi Joubu, apologies, but the test passes before and after the fix patch. Should it not fail before the fix patch?
Please double-check, it fails for me without the fix:
t/db_dependent/Record.t .. 1/18 # Failed test 'no warnings' # at /usr/share/perl/5.40/Test/Builder.pm line 193. # There were 1 warning(s) # Previous test 0 '' # Use of uninitialized value $2 in split at /kohadevbox/koha/C4/Record.pm line 924.
Before the patches, the tests pass for me in a default/fresh KTD after start up. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 --- Comment #11 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 --- Comment #12 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- (In reply to Jonathan Druart from comment #9)
Please double-check, it fails for me without the fix:
Yep, working as intended! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|26.11.00 |26.11.00,26.05.05 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 --- Comment #13 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to 26.05.x for the upcoming 26.05.05 release. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|Removes the cause of |Fixes a "Use of release notes|"[WARN] Use of |uninitialized value" |uninitialized value $2 in |warning in the OPAC error |split at |log, which appeared when |/kohadevbox/koha/C4/Record. |the Cite data was prepared |pm line 924." warnings from |for a record whose author |the plack-opac-error.log |field has a single word. No |when viewing record detail |change for patrons. |pages in the OPAC. This was | |related to the Cite | |feature. | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|Fixes a "Use of |Removes the cause of release notes|uninitialized value" |"[WARN] Use of |warning in the OPAC error |uninitialized value $2 in |log, which appeared when |split at |the Cite data was prepared |/kohadevbox/koha/C4/Record. |for a record whose author |pm line 924." warnings from |field has a single word. No |the plack-opac-error.log |change for patrons. |when viewing record detail | |pages in the OPAC. This was | |related to the Cite | |feature. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 --- Comment #14 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Hello, On 18 November I ran a bulk update of the "Text to go in release notes" field on bugs in the 26.11 range, to fill in missing notes using a consistent template. A mistake in that run also overwrote the release note you had written on this bug. That was not intended, and I am sorry for the noise. I have restored your original text from the bug history, so the field is exactly as you wrote it. Nothing else on this bug was changed. Thank you for writing the note. Martin -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|26.11.00,26.05.05 |26.11.00,26.05.05,25.11.11 released in| | CC| |baptiste.wojtkowski@biblibr | |e.com --- Comment #15 from Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> --- Pushed into 25.11.x for 25.11.11 nice work everyone -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41706 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org