Update ajax_inscr_gestion.php to improve error handling and include necessary function dependencies

This commit adds a required file inclusion for the `fxEveAccesResolveEveIdFromParId` function to ensure it is available during the execution of the 'par_statut_course' case. Additionally, it simplifies the error response for invalid actions by removing detailed diagnostic information, streamlining the error handling process while maintaining essential feedback for AJAX requests.
This commit is contained in:
2026-06-29 09:47:57 -04:00
parent 61bf838108
commit 8f04833b6a

View File

@ -28,6 +28,10 @@ register_shutdown_function(function () {
require_once 'php/inc_fonctions.php';
require_once 'php/inc_fx_promoteur.php';
require_once 'php/inc_fx_inscriptions_gestion.php';
// Necessaire pour fxEveAccesResolveEveIdFromParId() appelee dans le case
// 'par_statut_course' : ce fichier n'est sinon charge que paresseusement
// (fxInscrGestionLoadEveAcces) APRES ce premier appel -> fatal undefined function.
require_once 'php/inc_fx_eve_acces.php';
$intComId = intval($_SESSION['com_id'] ?? 0);
$strAction = trim((string)($_REQUEST['a'] ?? ''));
@ -130,24 +134,7 @@ switch ($strAction) {
break;
default:
// DIAGNOSTIC TEMPORAIRE : expose ce que le serveur a reellement recu
// pour comprendre pourquoi l'action ne matche aucun case.
$tabRetour = array(
'state' => 'error',
'message' => 'invalid_action',
'debug' => array(
'a_recu' => $strAction,
'a_len' => strlen($strAction),
'request_keys' => array_keys($_REQUEST),
'post_keys' => array_keys($_POST),
'get_keys' => array_keys($_GET),
'method' => $_SERVER['REQUEST_METHOD'] ?? '',
'content_type' => $_SERVER['CONTENT_TYPE'] ?? '',
),
);
error_log('[ajax_inscr_gestion] invalid_action a=' . json_encode($strAction)
. ' REQUEST_keys=' . json_encode(array_keys($_REQUEST))
. ' POST_keys=' . json_encode(array_keys($_POST)));
$tabRetour = array('state' => 'error', 'message' => 'invalid_action');
break;
}
} catch (\Throwable $e) {