Bug 501295

Summary: Status Whiteboard field in search form doesn't match with usestatuswhiteboard param
Product: [Community] Bugzilla Reporter: Noura El hawary <nelhawar>
Component: Query/Bug ListAssignee: Noura El hawary <nelhawar>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-19 12:23:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
v1 for code to fix status whiteboard issue with search form dkl: review+

Description Noura El hawary 2009-05-18 12:23:02 UTC
running the selenium test  t/testsuite/126_test_status_whiteboard.t uncovered an error in the search form, which is the status whiteboard field is always included in the search form whether the usestatuswhiteboard param is turned on or off, when looking at the code of the template template/en/default/search/form.html.tmpl I found that the code for checking the param is missing from the template comparing it to the upstream original code.

Noura

Comment 1 Noura El hawary 2009-05-18 12:27:20 UTC
Created attachment 344427 [details]
v1 for code to fix status whiteboard issue with search form

added missing code that checks usestatuswhiteboard param to determine whether to add the status whiteboard field or not to the search form.

Noura

Comment 2 David Lawrence 2009-05-18 19:41:27 UTC
Comment on attachment 344427 [details]
v1 for code to fix status whiteboard issue with search form

>Index: template/en/default/search/form.html.tmpl
>===================================================================
>--- template/en/default/search/form.html.tmpl	(revision 1267)
>+++ template/en/default/search/form.html.tmpl	(working copy)
>@@ -271,7 +271,9 @@
>     { name => "status_whiteboard", description => "Status <u>W</u>hiteboard",
>       accesskey => 'w' } 
>     ] %]
>-    
>+
>+    [% UNLESS field.name == 'status_whiteboard' AND NOT Param('usestatuswhiteboard') %]
>+     

Nit-pick: Perl Best Practices #66 says we should not use unless where if would work as well to help avoid confusion
of those coming from other languages that do not have negative conditional tests. Maybe use instead

    [% IF field.name == 'status_whiteboard' AND Param('usestatuswhiteboard') %]

But I leave this up to you if want to leave it as this technically works for me as well.

Dave


>     <tr>
>       <th align="right">
>         <label for="[% field.name %]" accesskey="[% field.accesskey %]">[% field.description %]</label>:
>@@ -290,6 +292,7 @@
>       </td>
>       <td></td>
>     </tr>
>+    [% END %]
>   [% END %]
> 
>   [% IF have_keywords %]

Comment 3 Noura El hawary 2009-05-19 12:23:25 UTC
Thanks for the review Dave,, I am going to leave it to UNLESS caze it is the original code of upstream that was deleted from our template.  

Noura