Description
Jonathan Druart
2020-01-07 15:53:39 UTC
Created attachment 96911 [details] [review] Bug 24367: Remove warning from Search.t Not done yet. Created attachment 97096 [details] [review] Bug 24367: Remove warning from Search.t Not done yet. Created attachment 97097 [details] [review] Bug 24367: DO NOT PUSH - update MARC records for tests The idea was to set the itemtype to a valid value (BK instead of BOOK) The exported_records was generated like: * add 942$c=MX when no 942$c exist * replace 942$c=BOOK with 942$c=BK But it did not remove remaining warnings I need help for this one. Created attachment 97157 [details] [review] Bug 24367: Resolve warn Argument available is not numeric in delete Argument "available" isn't numeric in delete at /usr/share/koha/C4/Search.pm line 1480. The construction delete array[string] simply does not work. Created attachment 97158 [details] [review] Bug 24367: Resolve warn Negative repeat count does nothing Negative repeat count does nothing at /usr/share/koha/Koha/QueryParser/Driver/PQF/query_plan.pm line 53. Negative repeat count does nothing at /usr/share/koha/Koha/QueryParser/Driver/PQF/query_plan/node.pm line 102. I am not sure if this statement actually does what the author intended, but adding the test on node_count/atom_count removes the warn. Repeating this change on query_plan.pm line 62. Had 42 warnings, now 28 left. Still working. Created attachment 97159 [details] [review] Bug 24367: Resolve warn Use of uninitialized value within [arrays] Use of uninitialized value within @operators in string eq at /usr/share/koha/C4/Search.pm line 1362. Use of uninitialized value within @indexes in pattern match (m//) at /usr/share/koha/C4/Search.pm line 1367. Trivial tests added. Created attachment 97163 [details] [review] Bug 24367: Resolve other uninitialized warns in Search.pm Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2074. Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2137. Use of uninitialized value in concatenation (.) or string at /usr/share/koha/C4/Search.pm line 2189. Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2213. Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2215. Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2225. Use of uninitialized value in hash element at /usr/share/koha/C4/Search.pm line 2226. The last path silences them all but contains a few arguable ones. Should we silence ones where an itemtype should be filled? (In reply to Marcel de Rooy from comment #10) > The last path silences them all but contains a few arguable ones. Should we > silence ones where an itemtype should be filled? Even with the patch from comment 3? (In reply to Jonathan Druart from comment #11) > (In reply to Marcel de Rooy from comment #10) > > The last path silences them all but contains a few arguable ones. Should we > > silence ones where an itemtype should be filled? > > Even with the patch from comment 3? Yes on top of the first. I tested a bit with/without the second. This is ready for testing. Test plan: Confirm that Search.t does not output warnings Eyeball the patch and try to catch possible regressions I still see one final warning: Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/C4/Search.pm line 1818. (In reply to Martin Renvoize from comment #14) > I still see one final warning: > > Use of uninitialized value in concatenation (.) or string at > /kohadevbox/koha/C4/Search.pm line 1818. I don't have this one, how did you get it? kohadev-koha@b2404290bde5:/kohadevbox/koha$ prove t/db_dependent/Search.t t/db_dependent/Search.t .. ok All tests successful. Files=1, Tests=2, 12 wallclock secs ( 0.04 usr 0.01 sys + 7.26 cusr 1.60 csys = 8.91 CPU) Result: PASS Interesting.. I got it by just running that one test in koha-testing-docker on stretch. Created attachment 99113 [details] [review] Bug 24367: May fix another warning May fix the following warning: Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/C4/Search.pm line 1818. (In reply to Jonathan Druart from comment #17) > Created attachment 99113 [details] [review] [review] > Bug 24367: May fix another warning > > May fix the following warning: > Use of uninitialized value in concatenation (.) or string at > /kohadevbox/koha/C4/Search.pm line 1818. Martin, this patch may fix the warning you got. But I am not sure we push it if you are the only one to have it. We should confirm with someone else. I tried with ES and Zebra, and both passed without warning without this patch applied. Lets push without that final patch.. hopefully it was just a blip on my system. Nice work everyone! Pushed to master for 20.05 not backported due to missing dependencies |