Bug 14145: Noisy warns in admin/preferences.pl
authorMark Tompsett <mtompset@hotmail.com>
Sat, 9 May 2015 05:31:37 +0000 (01:31 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 22 May 2015 12:37:24 +0000 (09:37 -0300)
commit7ad39b6fc950a0cfd68f1ea77caeab36630bd445
tree88665cc09a5d87f8cc116ab3bc35c7b331486bfd
parentb9a063f1718acb25b71d9a1df8b8db7d0717139a
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

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
To reproduce: go on the OPAC tab, OpacAdvSearchMoreOptions  or
OpacAdvSearchOptions should not have all options selected.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
admin/preferences.pl