diff --git a/ground/controllers/JsonController.php b/ground/controllers/JsonController.php index 665d808..d2b3b53 100644 --- a/ground/controllers/JsonController.php +++ b/ground/controllers/JsonController.php @@ -113,7 +113,6 @@ class JsonController extends Controller } $photos = $images = array(); - $ordering = $_POST['ordering']; if (empty($errors) && !App::$request['ajax'] && isset($_POST['id']) && (int) $_POST['id']) { $id = (int) $_POST['id']; @@ -156,6 +155,7 @@ class JsonController extends Controller } $resPhotos = array(); + $ordering = $_POST['ordering']; foreach ($ordering as $order) { $resPhotos[] = $order == 'FILE' ? array_shift($photos) : array_shift($images);