diff --git a/.env.dist b/.env.dist index e249f01ed..77dfe57f3 100755 --- a/.env.dist +++ b/.env.dist @@ -53,4 +53,4 @@ GATEKEEPER_SUBTITLE="This is a restricted development preview site. Please enter SSR_FPC_ENABLED=true LOG_BROWSER_ERRORS=false -AJAX_DISABLE_BATCHING=true +AJAX_DISABLE_BATCHING=false diff --git a/app/RSpade/Core/Ajax/Ajax_Batch_Controller.php b/app/RSpade/Core/Ajax/Ajax_Batch_Controller.php index 22319174d..532bf261d 100644 --- a/app/RSpade/Core/Ajax/Ajax_Batch_Controller.php +++ b/app/RSpade/Core/Ajax/Ajax_Batch_Controller.php @@ -20,8 +20,8 @@ use App\RSpade\Core\Controller\Rsx_Controller_Abstract; * * Response format: * { - * "C_0": {success: true, _ajax_return_value: {...}}, - * "C_1": {success: false, error_type: "...", reason: "..."}, + * "C_0": {_success: true, _ajax_return_value: {...}}, + * "C_1": {_success: false, error_type: "...", reason: "..."}, * ... * } * @@ -72,7 +72,7 @@ class Ajax_Batch_Controller extends Rsx_Controller_Abstract if ($call_id === null || !$controller || !$action) { $responses["C_{$call_id}"] = [ - 'success' => false, + '_success' => false, 'error_type' => 'invalid_call', 'reason' => 'Missing required fields: call_id, controller, or action', ]; @@ -83,9 +83,9 @@ class Ajax_Batch_Controller extends Rsx_Controller_Abstract // Make the Ajax call using Ajax::internal() $result = Ajax::internal($controller, $action, $call_params); - // Build success response + // Build success response (must use _success to match non-batched format) $response = [ - 'success' => true, + '_success' => true, '_ajax_return_value' => $result, ]; @@ -99,7 +99,7 @@ class Ajax_Batch_Controller extends Rsx_Controller_Abstract } catch (Exceptions\AjaxAuthRequiredException $e) { $responses["C_{$call_id}"] = [ - 'success' => false, + '_success' => false, 'error_code' => Ajax::ERROR_AUTH_REQUIRED, 'reason' => $e->getMessage(), 'metadata' => [], @@ -107,7 +107,7 @@ class Ajax_Batch_Controller extends Rsx_Controller_Abstract } catch (Exceptions\AjaxUnauthorizedException $e) { $responses["C_{$call_id}"] = [ - 'success' => false, + '_success' => false, 'error_code' => Ajax::ERROR_UNAUTHORIZED, 'reason' => $e->getMessage(), 'metadata' => [], @@ -115,7 +115,7 @@ class Ajax_Batch_Controller extends Rsx_Controller_Abstract } catch (Exceptions\AjaxFormErrorException $e) { $responses["C_{$call_id}"] = [ - 'success' => false, + '_success' => false, 'error_code' => Ajax::ERROR_VALIDATION, 'reason' => $e->getMessage(), 'metadata' => $e->get_details(), @@ -123,7 +123,7 @@ class Ajax_Batch_Controller extends Rsx_Controller_Abstract } catch (Exceptions\AjaxFatalErrorException $e) { $responses["C_{$call_id}"] = [ - 'success' => false, + '_success' => false, 'error_code' => Ajax::ERROR_FATAL, 'reason' => $e->getMessage(), 'metadata' => [], @@ -132,7 +132,7 @@ class Ajax_Batch_Controller extends Rsx_Controller_Abstract } catch (\Exception $e) { // Generic exception handler $responses["C_{$call_id}"] = [ - 'success' => false, + '_success' => false, 'error_type' => 'exception', 'reason' => $e->getMessage(), ];