Przeglądaj źródła

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

bastien 12 lat temu
rodzic
commit
9d2d04c0b4

+ 3 - 1
src/Muzich/CoreBundle/Controller/SearchController.php Wyświetl plik

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

+ 2 - 2
src/Muzich/CoreBundle/Resources/config/routing.yml Wyświetl plik

@@ -25,8 +25,8 @@ element_add:
25 25
   defaults: { _controller: MuzichCoreBundle:Core:elementAdd, group_slug: null }
26 26
 
27 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 31
 search_tag_ig_by_name:
32 32
   pattern: /search/tagid/{string_search}

+ 10 - 1
web/bundles/muzichcore/js/muzich.js Wyświetl plik

@@ -693,7 +693,12 @@ $(document).ready(function(){
693 693
       ajax_query_timestamp = new Date().getTime();
694 694
       
695 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 702
         if (data.status == 'mustbeconnected')
698 703
         {
699 704
           $(location).attr('href', url_index);
@@ -926,8 +931,12 @@ $(document).ready(function(){
926 931
           // On cache le loader
927 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