From f71f1ba6e23b7b3777ba2ea5d531bc2cf25da140 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Tue, 3 Mar 2015 19:28:44 -0500 Subject: [PATCH] Bug 13787 - Clean up noisy opac-advsearch warnings While testing bug 10937, there were noisy warnings, which distracted from testing the functionality of it. Here is a snippet of the after the patch warnings: Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 384. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 161. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 161. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 177. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 177. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 202. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 202. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 240. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 240. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 256. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 256. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 356. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 356. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 369. Argument "" isn't numeric in numeric gt (>) at /home/mtompset/kohaclone/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt line 369. Tweaking the [% IF %] statements eliminated the warnings. TEST PLAN --------- 1) Apply patch 2) Run koha qa test tools. -- there will be noisy warnings in the before processing, but there will be no such messages in the after processing. 3) git diff origin/master -- there should be no visible typos. Signed-off-by: Magnus Enger - Applied the patch from bug 10937 - Ran "koha-qa.pl -c 1" and observed the warnings described in the commit message - Applied the patch from this bug - Ran "koha-qa.pl -c 1" again and saw no warnings - Ran "koha-qa.pl -c 2" and saw no warnings I have not tested the functionality of 10937 with this patch, just verified that the changes look sensible. This patch feels more like a followup for 10937, than a separate patch, especially since 10937 is just "signed off" at this time. But as long as it works... Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../bootstrap/en/modules/opac-advsearch.tt | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt index 12dd94f339..79b9d64d30 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt @@ -111,7 +111,8 @@
- [% IF ( ( OpacAdvSearchOptions.grep('itemtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) %] + [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype').size > 0 and not expanded_options ) or + ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) %]
    @@ -145,7 +146,8 @@ [% END %]
    - [% IF ( ( OpacAdvSearchOptions.grep('pubdate').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions.grep('pubdate').size > 0 and expanded_options ) ) %] + [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('pubdate').size > 0 and not expanded_options ) or + ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('pubdate').size > 0 and expanded_options ) ) %]
    @@ -160,7 +162,8 @@
    [% END %] - [% IF ( ( OpacAdvSearchOptions.grep('language').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions.grep('language').size > 0 and expanded_options ) ) %] + [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('language').size > 0 and not expanded_options ) or + ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('language').size > 0 and expanded_options ) ) %]
    @@ -185,7 +188,8 @@
    [% END %] - [% IF ( ( OpacAdvSearchOptions.grep('location').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions.grep('location').size > 0 and expanded_options ) ) %] + [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('location').size > 0 and not expanded_options ) or + ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('location').size > 0 and expanded_options ) ) %] [% UNLESS ( singleBranchMode ) %]
    @@ -223,7 +227,8 @@ [% END # / UNLESS singleBranchMode %] [% END %] - [% IF ( ( OpacAdvSearchOptions.grep('sorting').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions.grep('sorting').size > 0 and expanded_options ) ) %] + [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('sorting').size > 0 and not expanded_options ) or + ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('sorting').size > 0 and expanded_options ) ) %]
    @@ -240,7 +245,8 @@ [% END %]
    - [% IF ( ( OpacAdvSearchOptions.grep('subtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions.grep('subtype').size > 0 and expanded_options ) ) %] + [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('subtype').size > 0 and not expanded_options ) or + ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('subtype').size > 0 and expanded_options ) ) %]
    [% IF ( usmarc ) %] @@ -340,7 +346,8 @@ [% END # / IF expanded_options %]
    - [% IF ( OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or ( OpacAdvSearchOptions.size > 0 and not expanded_options ) %] + [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or + ( OpacAdvSearchOptions and OpacAdvSearchOptions.size > 0 and not expanded_options ) %]
    @@ -359,7 +366,7 @@

    - [% IF OpacAdvSearchMoreOptions.size > 0 %] + [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 ) %] [% IF expanded_options %] Fewer options [% ELSIF not expanded_options %] -- 2.39.5