Summary: | Fix warn on URI/Escape.pm line 184 from opac-detail | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | Templates | Assignee: | Marcel de Rooy <m.de.rooy> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | ||
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 20422: Add unit test to Output.t for parametrized_url
Bug 20422: Fix warning on uri_escape_utf8 in Output.pm Bug 20422: Add unit test to Output.t for parametrized_url Bug 20422: Fix warning on uri_escape_utf8 in Output.pm Bug 20422: Add unit test to Output.t for parametrized_url Bug 20422: Fix warning on uri_escape_utf8 in Output.pm |
Description
Marcel de Rooy
2018-03-15 13:12:09 UTC
Created attachment 72952 [details] [review] Bug 20422: Add unit test to Output.t for parametrized_url This test will reveal that we need to resolve a warning too. Test plan: [1] Run t/Output.t without the second patch. [2] The test will fail on the warning raised by an undefined value. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 72953 [details] [review] Bug 20422: Fix warning on uri_escape_utf8 in Output.pm When opac-details calls parametrized_url, it triggers an uninitialized warning when you would have a record without e.g. author, like: Use of uninitialized value in subroutine entry at /usr/share/perl5/URI/Escape.pm line 184. This is (imo) actually a bug in URI::Escape; it should check its args. But we resolve the warning here by adding the "// q{}" in parametrized_url. NOTE: Along the way we do something similar in the arrParamsBusc loop. If the variable is undefined, jump to the next one. (Consistent with the approach in the if-part preceding it.) Test plan: [1] Run t/Output.t again. Should pass now. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 72954 [details] [review] Bug 20422: Add unit test to Output.t for parametrized_url This test will reveal that we need to resolve a warning too. Test plan: [1] Run t/Output.t without the second patch. [2] The test will fail on the warning raised by an undefined value. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Created attachment 72955 [details] [review] Bug 20422: Fix warning on uri_escape_utf8 in Output.pm When opac-details calls parametrized_url, it triggers an uninitialized warning when you would have a record without e.g. author, like: Use of uninitialized value in subroutine entry at /usr/share/perl5/URI/Escape.pm line 184. This is (imo) actually a bug in URI::Escape; it should check its args. But we resolve the warning here by adding the "// q{}" in parametrized_url. NOTE: Along the way we do something similar in the arrParamsBusc loop. If the variable is undefined, jump to the next one. (Consistent with the approach in the if-part preceding it.) Test plan: [1] Run t/Output.t again. Should pass now. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Created attachment 73210 [details] [review] Bug 20422: Add unit test to Output.t for parametrized_url This test will reveal that we need to resolve a warning too. Test plan: [1] Run t/Output.t without the second patch. [2] The test will fail on the warning raised by an undefined value. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 73211 [details] [review] Bug 20422: Fix warning on uri_escape_utf8 in Output.pm When opac-details calls parametrized_url, it triggers an uninitialized warning when you would have a record without e.g. author, like: Use of uninitialized value in subroutine entry at /usr/share/perl5/URI/Escape.pm line 184. This is (imo) actually a bug in URI::Escape; it should check its args. But we resolve the warning here by adding the "// q{}" in parametrized_url. NOTE: Along the way we do something similar in the arrParamsBusc loop. If the variable is undefined, jump to the next one. (Consistent with the approach in the if-part preceding it.) Test plan: [1] Run t/Output.t again. Should pass now. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Pushed to master for 18.05, thanks to everybody involved! |