Explorar el Código

Anomalie #724: Err 500

Sevajol Bastien hace 11 años
padre
commit
9c140b668e

+ 2 - 3
src/Muzich/CoreBundle/Controller/ElementController.php Ver fichero

@@ -1079,11 +1079,10 @@ class ElementController extends Controller
1079 1079
   
1080 1080
   public function getOneDomAction(Request $request, $element_id, $type)
1081 1081
   {
1082
-    if (!in_array($type, array('autoplay')))
1082
+    if (!in_array($type, array('autoplay')) || !$element_id)
1083 1083
     {
1084 1084
       return $this->jsonResponse(array(
1085
-        'status' => 'error',
1086
-        'errors' => array('NotAllowed')
1085
+        'status' => 'error'
1087 1086
       ));
1088 1087
     }
1089 1088
     

+ 6 - 1
src/Muzich/CoreBundle/Resources/public/js/autoplay.js Ver fichero

@@ -73,10 +73,15 @@ function Autoplay()
73 73
   {
74 74
     $('#autoplay_element_loader').show();
75 75
     JQueryJson(url_element_dom_get_one_autoplay+'/'+element_id, {}, function(response){
76
+      
77
+      $('#autoplay_element_loader').hide();
76 78
       if (response.status == 'success')
77 79
       {
78 80
         $('li#autoplay_element_container').html(response.data);
79
-        $('#autoplay_element_loader').hide();
81
+      }
82
+      else
83
+      {
84
+        $('li#autoplay_element_container').html('');
80 85
       }
81 86
     });
82 87
   }