[Bug 10494] New: KohaBranchName sends useless warnings to log if supplied library code is null or not present
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 Bug ID: 10494 Summary: KohaBranchName sends useless warnings to log if supplied library code is null or not present Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: gmcharlt@gmail.com If the library code passed to the KohaBranchName Template Toolkit plugin is NULL or isn't present in the database (which can happen, legitimately, in suggestion management), spurious warnings can get logged. For example, here's one that gets displayed when viewing purchase suggestions in the staff interface if any of the suggestions have branchcode either NULL or set to '__ANY__'. [Wed Jun 19 07:13:06 2013] [error] [client 192.168.1.10] [Wed Jun 19 07:13:06 2013] suggestion.pl: Use of uninitialized value in concatenation (.) or string at /home/gmc/koha/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt line 487., referer: http://koha-staff.metaquarry/cgi-bin/koha/acqui/acqui-home.pl Rather than return undef in such cases, the plugin should return the empty string. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |trivial -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 --- Comment #1 from Galen Charlton <gmcharlt@gmail.com> --- Created attachment 19157 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19157&action=edit Bug 10494: test cases for the KohaBranchName plugin To test, in a test database that has the sample branches loaded, run prove -v t/db_dependent/Koha_template_plugin_KohaBranchName.t Note that this includes regression tests for the issues reported in bug 10494; these won't pass without applying the patch that fixes them. Signed-off-by: Galen Charlton <gmc@esilibrary.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 --- Comment #2 from Galen Charlton <gmcharlt@gmail.com> --- Created attachment 19158 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19158&action=edit Bug 10494: remove spurious warnings from the KohaBranchName plugin The KohaBranchName plugin now returns an empty string if given a NULL (undefined) library code or a library code that is not present in the database (e.g., the '__ANY__' placeholder that purchase suggestions can use). To test: [1] Create a purchase suggestion, setting the library to 'Any'. Create a second one setting the library to a specific one. [2] Go to the suggestions overview page in the staff interface. When you do so, the Apache logs should contain a warning that looks like this: [Wed Jun 19 07:13:06 2013] [error] [client 192.168.1.10] [Wed Jun 19 07:13:06 2013] suggestion.pl: Use of uninitialized value in concatenation (.) or string at /home/koha/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt line 487., referer: http://koha-staff.metaquarry/cgi-bin/koha/acqui/acqui-home.pl [3] Apply the patch. [4] Refresh the suggestions overview page. This time, there should be no new warning logged. [5] Verify that the library names for the two pending suggestions created in step 1 are displayed correctly. Signed-off-by: Galen Charlton <gmc@esilibrary.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19157|0 |1 is obsolete| | --- Comment #3 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 19292 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19292&action=edit Bug 10494: test cases for the KohaBranchName plugin To test, in a test database that has the sample branches loaded, run prove -v t/db_dependent/Koha_template_plugin_KohaBranchName.t Note that this includes regression tests for the issues reported in bug 10494; these won't pass without applying the patch that fixes them. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19158|0 |1 is obsolete| | --- Comment #4 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 19293 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19293&action=edit Bug 10494: remove spurious warnings from the KohaBranchName plugin The KohaBranchName plugin now returns an empty string if given a NULL (undefined) library code or a library code that is not present in the database (e.g., the '__ANY__' placeholder that purchase suggestions can use). To test: [1] Create a purchase suggestion, setting the library to 'Any'. Create a second one setting the library to a specific one. [2] Go to the suggestions overview page in the staff interface. When you do so, the Apache logs should contain a warning that looks like this: [Wed Jun 19 07:13:06 2013] [error] [client 192.168.1.10] [Wed Jun 19 07:13:06 2013] suggestion.pl: Use of uninitialized value in concatenation (.) or string at /home/koha/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt line 487., referer: http://koha-staff.metaquarry/cgi-bin/koha/acqui/acqui-home.pl [3] Apply the patch. [4] Refresh the suggestions overview page. This time, there should be no new warning logged. [5] Verify that the library names for the two pending suggestions created in step 1 are displayed correctly. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Assignee|oleonard@myacpl.org |gmcharlt@gmail.com QA Contact| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19292|0 |1 is obsolete| | Attachment #19293|0 |1 is obsolete| | --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 19301 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19301&action=edit [PASSED QA] Bug 10494: test cases for the KohaBranchName plugin To test, in a test database that has the sample branches loaded, run prove -v t/db_dependent/Koha_template_plugin_KohaBranchName.t Note that this includes regression tests for the issues reported in bug 10494; these won't pass without applying the patch that fixes them. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 19302 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19302&action=edit [PASSED QA] Bug 10494: remove spurious warnings from the KohaBranchName plugin The KohaBranchName plugin now returns an empty string if given a NULL (undefined) library code or a library code that is not present in the database (e.g., the '__ANY__' placeholder that purchase suggestions can use). To test: [1] Create a purchase suggestion, setting the library to 'Any'. Create a second one setting the library to a specific one. [2] Go to the suggestions overview page in the staff interface. When you do so, the Apache logs should contain a warning that looks like this: [Wed Jun 19 07:13:06 2013] [error] [client 192.168.1.10] [Wed Jun 19 07:13:06 2013] suggestion.pl: Use of uninitialized value in concatenation (.) or string at /home/koha/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt line 487., referer: http://koha-staff.metaquarry/cgi-bin/koha/acqui/acqui-home.pl [3] Apply the patch. [4] Refresh the suggestions overview page. This time, there should be no new warning logged. [5] Verify that the library names for the two pending suggestions created in step 1 are displayed correctly. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes all tests and QA script. Also adds new tests! Note: For the test plan to work you have to add the suggestion from the intranet, as Any is not an available option in OPAC. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #7 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |tomascohen@gmail.com --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This patch has been pushed to 3.12.x, will be in 3.12.2. Thanks Galen! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10494 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bgkriegel@gmail.com --- Comment #9 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Pushed to 3.10.x, will be in 3.10.10 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org