Bug 23712

Summary: Silence warns from Koha/Illrequest/Logger.pm
Product: Koha Reporter: Magnus Enger <magnus>
Component: ILLAssignee: Magnus Enger <magnus>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: trivial    
Priority: P5 - low CC: m.de.rooy
Version: master   
Hardware: All   
OS: All   
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
Bug 23712 - Silence warns from Koha/Illrequest/Logger.pm
Bug 23712 - Silence warns from Koha/Illrequest/Logger.pm
Bug 23712: (QA follow-up) Silence two other warns too

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