Browse Source

Evolution #166: Rajout d'un if pour ne traiter le formulaire que lorsque l'on est en method POST.

bastien 12 years ago
parent
commit
0eb84b35fc
1 changed files with 11 additions and 7 deletions
  1. 11 7
      src/Muzich/CoreBundle/Controller/SearchController.php

+ 11 - 7
src/Muzich/CoreBundle/Controller/SearchController.php View File

@@ -297,19 +297,23 @@ class SearchController extends Controller
297 297
   public function globalAction(Request $request)
298 298
   {
299 299
     $form = $this->getGlobalSearchForm($searcher = new GlobalSearcher());
300
-    $form->bindRequest($request);
301 300
     $results = array(
302 301
       'users'    => null,
303 302
       'groups'   => null,
304 303
       'elements' => null
305 304
     );
306
-    if ($form->isValid())
305
+    
306
+    if ($request->getMethod() == 'POST')
307 307
     {
308
-      $results = $searcher->getResults(
309
-        $this->getDoctrine(), 
310
-        $this->getUserId(),
311
-        $this->container->getParameter('search_global_elements_word_min_length')
312
-      );
308
+      $form->bindRequest($request);
309
+      if ($form->isValid())
310
+      {
311
+        $results = $searcher->getResults(
312
+          $this->getDoctrine(), 
313
+          $this->getUserId(),
314
+          $this->container->getParameter('search_global_elements_word_min_length')
315
+        );
316
+      }
313 317
     }
314 318
     
315 319
     return array(