Browse Source

Anomalie #186: TagPrompt: err si http://

bastien 13 years ago
parent
commit
9d2d04c0b4

+ 3 - 1
src/Muzich/CoreBundle/Controller/SearchController.php View File

190
    * @param int $timestamp
190
    * @param int $timestamp
191
    * @return Response 
191
    * @return Response 
192
    */
192
    */
193
-  public function searchTagAction($string_search, $timestamp)
193
+  public function searchTagAction($timestamp)
194
   {
194
   {
195
     if (($response = $this->mustBeConnected()))
195
     if (($response = $this->mustBeConnected()))
196
     {
196
     {
197
       return $response;
197
       return $response;
198
     }
198
     }
199
     
199
     
200
+    $string_search = $this->getRequest()->request->get('string_search');
201
+    
200
     if ($this->getRequest()->isXmlHttpRequest())
202
     if ($this->getRequest()->isXmlHttpRequest())
201
     {
203
     {
202
       if (strlen(trim($string_search)) > 1)
204
       if (strlen(trim($string_search)) > 1)

+ 2 - 2
src/Muzich/CoreBundle/Resources/config/routing.yml View File

25
   defaults: { _controller: MuzichCoreBundle:Core:elementAdd, group_slug: null }
25
   defaults: { _controller: MuzichCoreBundle:Core:elementAdd, group_slug: null }
26
 
26
 
27
 search_tag:
27
 search_tag:
28
-  pattern: /search/tag/{string_search}/{timestamp}
29
-  defaults: { _controller: MuzichCoreBundle:Search:searchTag, string_search: null, timestamp: null }
28
+  pattern: /search/tag/{timestamp}
29
+  defaults: { _controller: MuzichCoreBundle:Search:searchTag, timestamp: null }
30
   
30
   
31
 search_tag_ig_by_name:
31
 search_tag_ig_by_name:
32
   pattern: /search/tagid/{string_search}
32
   pattern: /search/tagid/{string_search}

+ 10 - 1
web/bundles/muzichcore/js/muzich.js View File

693
       ajax_query_timestamp = new Date().getTime();
693
       ajax_query_timestamp = new Date().getTime();
694
       
694
       
695
       // Récupération des tags correspondants
695
       // Récupération des tags correspondants
696
-      $.getJSON(url_search_tag+'/'+input.val()+'/'+ajax_query_timestamp, function(data) {
696
+      $.ajax({
697
+        type: 'POST',
698
+        url: url_search_tag+'/'+ajax_query_timestamp,
699
+        dataType: 'json',
700
+        data: {'string_search':input.val()},
701
+        success: function(data) {
697
         if (data.status == 'mustbeconnected')
702
         if (data.status == 'mustbeconnected')
698
         {
703
         {
699
           $(location).attr('href', url_index);
704
           $(location).attr('href', url_index);
926
           // On cache le loader
931
           // On cache le loader
927
           $('#tag_loader_'+form_name).hide();
932
           $('#tag_loader_'+form_name).hide();
928
         }
933
         }
934
+      }
929
       });
935
       });
930
       
936
       
937
+      
938
+      //$.getJSON(url_search_tag+'/'+input.val()+'/'+ajax_query_timestamp, );
939
+      
931
     }
940
     }
932
   }
941
   }
933
  
942