Bug 10728

Summary: subscription-renew generates unnecessary warnings in logs
Product: Koha Reporter: Colin Campbell <colin.campbell>
Component: SerialsAssignee: Colin Campbell <colin.campbell>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: trivial    
Priority: P5 - low CC: bgkriegel, chrish, colin.campbell, gmcharlt, jonathan.druart, tomascohen
Version: Main   
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:
Attachments: Proposed patch
Bug 10728: fix log noise generated by subscription-renew.pl
bug 10728: fix additional log noise generated by subscription-renew.pl
Bug 10728: fix log noise generated by subscription-renew.pl
bug 10728: fix additional log noise generated by subscription-renew.pl

Description Colin Campbell 2013-08-14 14:21:54 UTC
subscription-renew.pl generates warnings in the logs if mode is undefined, set a default value to cut down the noise. Can use the mode variable which is otherwise created for no reason
Comment 1 Colin Campbell 2013-08-14 14:33:08 UTC Comment hidden (obsolete)
Comment 2 Galen Charlton 2013-08-14 14:55:05 UTC Comment hidden (obsolete)
Comment 3 Galen Charlton 2013-08-14 14:55:10 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2013-08-19 13:56:05 UTC
Created attachment 20462 [details] [review]
Bug 10728: fix log noise generated by subscription-renew.pl

Error log is showing warnings because mode is undefined
and we are doing string comparisons on it.

Set it to a default value (we were already assigning it a variable
which we were not using) and use the the result in the comparison

To test, after applying the patch:

[1] Use the renew link from the subscription detail page to renew
    a subscription.
[2] Verifying that doing this did not add a warning containing
    'subscription-renew.pl: Use of uninitialized value $mode in string eq '
    to the Apache error log.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 5 Jonathan Druart 2013-08-19 13:56:09 UTC
Created attachment 20463 [details] [review]
bug 10728: fix additional log noise generated by subscription-renew.pl

To test:

[1] Use the renew link to bring up the subscription renewal form.
[2] Verify that a warning message containing the text
    'Problem = a value of 1 has been passed to param without key'
    was not added to the Apache error log.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 6 Galen Charlton 2013-08-19 14:11:15 UTC
Pushed to master.  Thanks, Colin!
Comment 7 Tomás Cohen Arazi 2013-09-13 14:37:14 UTC
This patch has been pushed to 3.12.x, will be in 3.12.5.

Thanks Colin!
Comment 8 Bernardo Gonzalez Kriegel 2013-09-15 01:41:47 UTC
Pushed to 3.10.x, will be in 3.10.11
Comment 9 Chris Hall 2013-10-21 19:44:31 UTC
Pushed to 3.8.x, will be in 3.8.19
Comment 10 Chris Hall 2013-11-22 21:55:25 UTC
First patch was in 3.8.19, second patch will be in 3.8.20.