MSIN-4479 — Update alert messages in bib-assignments.js and inc_fx_promoteur.php to use new dataset keys for error handling. Ensure count function handles null results correctly to prevent JSON pollution. Increment version code to 4.72.869.

This commit is contained in:
2026-07-24 13:05:56 -04:00
parent 5961b40349
commit 797223e976
3 changed files with 10 additions and 7 deletions

View File

@ -2408,7 +2408,8 @@
if (!/^\d+$/.test(strQteTotale)
|| !Number.isSafeInteger(intQteTotale)
|| intQteTotale > 9999999) {
alert(bibJs('err-generic'));
// MSIN-4479 — data-js-err-generic → dataset.jsErrGeneric
alert(bibJs('jsErrGeneric') || 'Erreur');
return;
}
@ -2443,10 +2444,10 @@
bibApplyQteData(result.data);
return;
}
alert((result && result.message) || bibJs('err-generic'));
alert((result && result.message) || bibJs('jsErrGeneric') || 'Erreur');
})
.catch(function () {
alert(bibJs('server-error'));
alert(bibJs('jsServerError') || bibJs('jsErrGeneric') || 'Erreur serveur');
})
.finally(function () {
bibLoaderHide();

View File

@ -2641,7 +2641,8 @@ function fxGetQuantitesEvenement($intEpreuve) {
$sqlInscriptions = 'select p.no_bib, p.par_id, p.par_prenom, p.par_nom, e.pec_id_original, e.epr_id, e.eve_id, e.pec_id, e.is_cancelled, p.rol_id, e.no_commande, e.no_panier, e.no_equipe from resultats_epreuves_commandees e, resultats_participants p where p.is_cancelled = 0 AND p.epr_id = ' . intval($tabEpreuve['epr_id']) . ' AND p.epr_id = e.epr_id and p.pec_id = e.pec_id_original group by e.pec_id_original';
$tabInscriptions = $objDatabase->fxGetResults($sqlInscriptions);
$intNbInscriptions = count($tabInscriptions);
// MSIN-4479 — fxGetResults peut renvoyer null (0 ligne) ; count(null) pollue le JSON AJAX si display_errors.
$intNbInscriptions = is_array($tabInscriptions) ? count($tabInscriptions) : 0;
$intTotalOriginal += $tabEpreuve['epr_qte_origine'];
$intTotalAvailable += $tabEpreuve['epr_qte'];
@ -2681,7 +2682,8 @@ function fxGetQuantites($intEpreuve) {
$sqlInscriptions = 'select p.no_bib, p.par_id, p.par_prenom, p.par_nom, e.pec_id_original, e.epr_id, e.eve_id, e.pec_id, e.is_cancelled, p.rol_id, e.no_commande, e.no_panier, e.no_equipe from resultats_epreuves_commandees e, resultats_participants p where p.is_cancelled = 0 AND p.epr_id = ' . intval($intEpreuve) . ' AND p.epr_id = e.epr_id and p.pec_id = e.pec_id_original group by e.pec_id_original';
$tabInscriptions = $objDatabase->fxGetResults($sqlInscriptions);
$intNbInscriptions = count($tabInscriptions);
// MSIN-4479 — même garde que fxGetQuantitesEvenement (null = 0 inscription).
$intNbInscriptions = is_array($tabInscriptions) ? count($tabInscriptions) : 0;
$arrRetour = array(
'qte_origine' => intval($tabEpreuve['epr_qte_origine']),

View File

@ -7,8 +7,8 @@
* Constantes *
*
**************/
define('_VERSION_CODE', '4.72.868'); // mise en prod — cache-bust loader CSS/JS (ms1-loader)
define('_DATE_CODE', '2026-07-23');
define('_VERSION_CODE', '4.72.869'); // MSIN-4479 — cache-bust bib-assignments (alert qte)
define('_DATE_CODE', '2026-07-24');
//MSIN-4290
define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');