[Bug 41713] New: warnings sometimes generated when using ShowComponentRecords feature
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41713 Bug ID: 41713 Summary: warnings sometimes generated when using ShowComponentRecords feature Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: januszop@gmail.com QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl When using ShowComponentRecords feature warnings like: [WARN] Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 352. [WARN] Use of uninitialized value $comp_query_str in concatenation (.) or string at /kohadevbox/koha/catalogue/detail.pl line 273. are generated from staff interface detail view when: 1. ShowComponentRecords = 'both' or 'staff' AND 2. UseControlNumber is on AND 3. record lacks 001 field Similarly, from OPAC interface: [WARN] Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 352. [WARN] Use of uninitialized value $comp_query_str in concatenation (.) or string at /kohadevbox/koha/opac/opac-detail.pl line 640. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41713 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41713 --- Comment #1 from Janusz Kaczmarek <januszop@gmail.com> --- Created attachment 192054 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192054&action=edit Bug 41713: warnings sometimes generated when using ShowComponentRecords feature When using ShowComponentRecords feature warnings are generated from staff interface detail view when: 1. ShowComponentRecords = 'both' or 'staff' AND 2. UseControlNumber is on AND 3. record lacks 001 field Test plan ========= 1. Have a standard ktd instance with Elasticsearch. 2. Set UseControlNumber systempreference to Use. 3. In OPAC and in staff interface, open in Normal view a record without field 001, e.g. # 399 ("Art Since 1980"). 4. Check plack-opac-error.log and plack-intranet-error.log. You should see fresh warnings like: [WARN] Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 352. [WARN] Use of uninitialized value $comp_query_str in concatenation (.) or string at /kohadevbox/koha/opac/opac-detail.pl line 640 [WARN] Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 352. [WARN] Use of uninitialized value $comp_query_str in concatenation (.) or string at /kohadevbox/koha/catalogue/detail.pl line 273. 5. Apply the patch; restart_all. 6. Repeat p. 4. There should be no new warnings. Sponsored-by: Ignatianum University in Cracow -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41713 --- Comment #2 from Janusz Kaczmarek <januszop@gmail.com> --- Created attachment 192055 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192055&action=edit Bug 41713: Unit tests -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41713 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |januszop@gmail.com |ity.org | Comma delimited| |Ignatianum University in list of Sponsors| |Cracow Sponsorship status|--- |Sponsored Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41713 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192054|0 |1 is obsolete| | Attachment #192055|0 |1 is obsolete| | --- Comment #3 from Janusz Kaczmarek <januszop@gmail.com> --- Created attachment 192056 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192056&action=edit Bug 41713: warnings sometimes generated when using ShowComponentRecords feature When using ShowComponentRecords feature warnings are generated from staff interface detail view when: 1. ShowComponentRecords = 'both' or 'staff' AND 2. UseControlNumber is on AND 3. record lacks 001 field Test plan ========= 1. Have a standard ktd instance with Elasticsearch. 2. Set UseControlNumber systempreference to Use. Set ShowComponentRecords systempreference to both staff and OPAC. 3. In OPAC and in staff interface, open in Normal view a record without field 001, e.g. # 399 ("Art Since 1980"). 4. Check plack-opac-error.log and plack-intranet-error.log. You should see fresh warnings like: [WARN] Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 352. [WARN] Use of uninitialized value $comp_query_str in concatenation (.) or string at /kohadevbox/koha/opac/opac-detail.pl line 640 [WARN] Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 352. [WARN] Use of uninitialized value $comp_query_str in concatenation (.) or string at /kohadevbox/koha/catalogue/detail.pl line 273. 5. Apply the patch; restart_all. 6. Repeat p. 4. There should be no new warnings. 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=41713 --- Comment #4 from Janusz Kaczmarek <januszop@gmail.com> --- Created attachment 192057 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192057&action=edit Bug 41713: Unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41713 --- Comment #5 from Janusz Kaczmarek <januszop@gmail.com> --- Nota bene: the key change is to examine the @{$components} array, not the reference to the array ($components) in 'if' statement. In the old version: if ( my $components = $biblio->get_marc_components(... the condition is always true since get_marc_components always returns an array reference, even if if is an empty array. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41713 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41713 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41713 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192056|0 |1 is obsolete| | Attachment #192057|0 |1 is obsolete| | --- Comment #6 from Roman Dolny <roman.dolny@jezuici.pl> --- Created attachment 192106 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192106&action=edit Bug 41713: warnings sometimes generated when using ShowComponentRecords feature When using ShowComponentRecords feature warnings are generated from staff interface detail view when: 1. ShowComponentRecords = 'both' or 'staff' AND 2. UseControlNumber is on AND 3. record lacks 001 field Test plan ========= 1. Have a standard ktd instance with Elasticsearch. 2. Set UseControlNumber systempreference to Use. Set ShowComponentRecords systempreference to both staff and OPAC. 3. In OPAC and in staff interface, open in Normal view a record without field 001, e.g. # 399 ("Art Since 1980"). 4. Check plack-opac-error.log and plack-intranet-error.log. You should see fresh warnings like: [WARN] Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 352. [WARN] Use of uninitialized value $comp_query_str in concatenation (.) or string at /kohadevbox/koha/opac/opac-detail.pl line 640 [WARN] Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 352. [WARN] Use of uninitialized value $comp_query_str in concatenation (.) or string at /kohadevbox/koha/catalogue/detail.pl line 273. 5. Apply the patch; restart_all. 6. Repeat p. 4. There should be no new warnings. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny <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=41713 --- Comment #7 from Roman Dolny <roman.dolny@jezuici.pl> --- Created attachment 192107 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192107&action=edit Bug 41713: Unit tests Signed-off-by: Roman Dolny <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=41713 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | Status|Signed Off |Failed QA --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Changes in the first patch look good to me. Have my doubts on the second patch. + t::lib::Mocks::mock_preference( 'SearchEngine', 'Elasticsearch' ); During this subtest, this pref was mocked to Zebra before. Should it be set back? Not sure.. What about the mocks for doing a search on Elastic? You cant really query a search engine here. (You are calling search_compat. See the mocks for Zebra.) And if we are mocking those routines, what is still the use of this test? Can we do without the second patch? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41713 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Another observation (out of scope) shift @$operators; # Shift out the one we unshifted before => But this is only done when the $scan is false ! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org