Bugzilla – Attachment 39051 Details for
Bug 14145
Noisy warns in admin/preferences.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 14145: Noisy warns in admin/preferences.pl
SIGNED-OFF-Bug-14145-Noisy-warns-in-adminpreferenc.patch (text/plain), 2.26 KB, created by
Bernardo Gonzalez Kriegel
on 2015-05-11 18:26:33 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 14145: Noisy warns in admin/preferences.pl
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2015-05-11 18:26:33 UTC
Size:
2.26 KB
patch
obsolete
>From c8906a5bd9d90d7aaad732f548274bdb4ee5b72d Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Sat, 9 May 2015 01:31:37 -0400 >Subject: [PATCH] [SIGNED-OFF] Bug 14145: Noisy warns in admin/preferences.pl > >The problem with the odd number of hashes happens when not everything is selected. >The grep returns undef, because it isn't found in @values. >By turning the grep into a ternary-operator truth value, we can set a value (1 or 0) expressly. > >The next problem is when nothing is selected in these multiple lists, $value is >undefined, so you can't split it. By splitting the definition of @values from >the actual splitting, we can split only if $value is defined, thus eliminating the >warning message. > >TEST PLAN >--------- >1) back up your koha error log file >2) blank your koha error log file >3) log in to the staff client >4) Home -> Koha administration -> Global system preferences >5) Click on every tab, EXCEPT local use. >6) notice the koha error log file has warnings. >7) blank the koha error log file again >8) apply this patch >9) Click on every tab, EXCEPT local use, again. >10) notice the koha error log file has no warnings. >11) koha qa test tools. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >I like more this version >Works as described >No koha-qa errors >--- > admin/preferences.pl | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/admin/preferences.pl b/admin/preferences.pl >index 1bd961e..d9683f1 100755 >--- a/admin/preferences.pl >+++ b/admin/preferences.pl >@@ -106,7 +106,8 @@ sub _get_chunk { > keys %{ $options{'choices'} } > ]; > } elsif ( $options{'multiple'} ) { >- my @values = split /,/, $value; >+ my @values; >+ @values = split /,/, $value if defined($value); > $chunk->{type} = 'multiple'; > $chunk->{CHOICES} = [ > sort { $a->{'text'} cmp $b->{'text'} } >@@ -115,7 +116,7 @@ sub _get_chunk { > { > text => $options{multiple}->{$option_value}, > value => $option_value, >- selected => grep /^$option_value$/, @values, >+ selected => (grep /^$option_value$/, @values) ? 1 : 0, > } > } > keys %{ $options{multiple} } >-- >1.7.9.5
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 14145
:
38838
|
38839
|
38999
|
39051
|
39384