Bugzilla – Attachment 19158 Details for
Bug 10494
KohaBranchName sends useless warnings to log if supplied library code is null or not present
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10494: remove spurious warnings from the KohaBranchName plugin
Bug-10494-remove-spurious-warnings-from-the-KohaBr.patch (text/plain), 2.25 KB, created by
Galen Charlton
on 2013-06-19 15:58:38 UTC
(
hide
)
Description:
Bug 10494: remove spurious warnings from the KohaBranchName plugin
Filename:
MIME Type:
Creator:
Galen Charlton
Created:
2013-06-19 15:58:38 UTC
Size:
2.25 KB
patch
obsolete
>From 02ac3428b88d088026a2985f81c3fa00c5702c15 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Wed, 19 Jun 2013 08:52:56 -0700 >Subject: [PATCH] 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> >--- > Koha/Template/Plugin/KohaBranchName.pm | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > >diff --git a/Koha/Template/Plugin/KohaBranchName.pm b/Koha/Template/Plugin/KohaBranchName.pm >index a39aba0..51d1a44 100644 >--- a/Koha/Template/Plugin/KohaBranchName.pm >+++ b/Koha/Template/Plugin/KohaBranchName.pm >@@ -17,19 +17,17 @@ package Koha::Template::Plugin::KohaBranchName; > # with Koha; if not, write to the Free Software Foundation, Inc., > # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > >-use strict; >-use warnings; >+use Modern::Perl; > > use Template::Plugin::Filter; > use base qw( Template::Plugin::Filter ); >-use warnings; >-use strict; > > use C4::Branch qw( GetBranchName );; > > sub filter { >- my ($self,$branchcode) = @_; >- return GetBranchName( $branchcode ); >+ my ($self, $branchcode) = @_; >+ my $name = GetBranchName( $branchcode ); >+ return defined($name) ? $name : ''; > } > > 1; >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10494
:
19157
|
19158
|
19292
|
19293
|
19301
|
19302