Bug 23712 - Silence warns from Koha/Illrequest/Logger.pm
Summary: Silence warns from Koha/Illrequest/Logger.pm
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Magnus Enger
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-01 14:39 UTC by Magnus Enger
Modified: 2020-06-04 20:35 UTC (History)
1 user (show)

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


Attachments
Bug 23712 - Silence warns from Koha/Illrequest/Logger.pm (1.20 KB, patch)
2019-10-01 14:44 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 23712 - Silence warns from Koha/Illrequest/Logger.pm (1.27 KB, patch)
2019-10-02 12:05 UTC, Brendan Gallagher
Details | Diff | Splinter Review
Bug 23712 - Silence warns from Koha/Illrequest/Logger.pm (1.36 KB, patch)
2019-10-18 12:36 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 23712: (QA follow-up) Silence two other warns too (1.35 KB, patch)
2019-10-18 12:36 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2019-10-01 14:39:10 UTC
If you run this:

$ sudo koha-shell -c "prove t/db_dependent/Illrequests.t" kohadev

you get a lot of errors like this:

no query in themelanguage at /home/vagrant/kohaclone/C4/Templates.pm line 266.

This is because C4::Templates::_get_template_file() is called with just two parameters, when it expects a CGI object as the third parameter:

C4::Templates::_get_template_file('ill/log/', 'intranet');

Patch coming.
Comment 1 Magnus Enger 2019-10-01 14:40:16 UTC
There are probably many ways to solve this, but I will propose to add a new CGI object and pass it along. Alternative solutions welcome!
Comment 2 Magnus Enger 2019-10-01 14:44:26 UTC
Created attachment 93376 [details] [review]
Bug 23712 - Silence warns from Koha/Illrequest/Logger.pm

To test:
- Run: $ sudo koha-shell -c "prove t/db_dependent/Illrequests.t" kohadev
- Observe the warnings about "no query in themelanguage"
- Apply the patch
- Run prove again
- Observe the lack of warnings about "no query in themelanguage"
  (There will be a couple of other warnings, but they are not
  related to the present bug.)
Comment 3 Brendan Gallagher 2019-10-02 12:05:13 UTC
Created attachment 93441 [details] [review]
Bug 23712 - Silence warns from Koha/Illrequest/Logger.pm

To test:
- Run: $ sudo koha-shell -c "prove t/db_dependent/Illrequests.t" kohadev
- Observe the warnings about "no query in themelanguage"
- Apply the patch
- Run prove again
- Observe the lack of warnings about "no query in themelanguage"
  (There will be a couple of other warnings, but they are not
  related to the present bug.)

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Comment 4 Marcel de Rooy 2019-10-18 12:36:19 UTC
t/db_dependent/Illrequests.t .. 4/11
Use of uninitialized value in concatenation (.) or string at /usr/share/koha/Koha/Illrequest.pm line 857.
Use of uninitialized value in concatenation (.) or string at /usr/share/koha/Koha/Illrequest.pm line 859.
Comment 5 Marcel de Rooy 2019-10-18 12:36:39 UTC
Created attachment 94407 [details] [review]
Bug 23712 - Silence warns from Koha/Illrequest/Logger.pm

To test:
- Run: $ sudo koha-shell -c "prove t/db_dependent/Illrequests.t" kohadev
- Observe the warnings about "no query in themelanguage"
- Apply the patch
- Run prove again
- Observe the lack of warnings about "no query in themelanguage"
  (There will be a couple of other warnings, but they are not
  related to the present bug.)

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Marcel de Rooy 2019-10-18 12:36:43 UTC
Created attachment 94408 [details] [review]
Bug 23712: (QA follow-up) Silence two other warns too

Caused by undefined method:
Use of uninitialized value in concatenation (.) or string at /usr/share/koha/Koha/Illrequest.pm line 857.
Use of uninitialized value in concatenation (.) or string at /usr/share/koha/Koha/Illrequest.pm line 859.

Test plan:
Run test again

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 7 Martin Renvoize 2019-10-21 08:46:13 UTC
Nice work!

Pushed to master for 19.11.00