This commit is contained in:
theShlavuk 2026-01-21 22:52:55 +01:00
parent 9369ee17ce
commit 200f6aab15
2 changed files with 19 additions and 1 deletions

View File

@ -594,8 +594,15 @@ class CRVI_Event_Model extends Main_Model {
* get departement nom
*/
public function get_departement_nom($id_departement) {
if (empty($id_departement)) {
return '';
}
$departement = get_term_by('id', $id_departement, 'departement');
if (!$departement || is_wp_error($departement)) {
return '';
}
return $departement->name;
}
@ -603,7 +610,15 @@ class CRVI_Event_Model extends Main_Model {
* get type_intervention nom
*/
public function get_type_intervention_nom($id_type_intervention) {
if (empty($id_type_intervention)) {
return '';
}
$type_intervention = get_term_by('id', $id_type_intervention, 'type_intervention');
if (!$type_intervention || is_wp_error($type_intervention)) {
return '';
}
return $type_intervention->name;
}

View File

@ -991,9 +991,12 @@ class CRVI_TraductionLangue_Model extends Main_Model {
if ($use_cache) {
$cached = \get_transient($cache_key);
if ($cached !== false) {
error_log('🔍 Cache utilisé pour ' . $cache_key . ' - Résultat: ' . (empty($cached) ? 'vide' : count($cached) . ' langues'));
return $cached;
}
}
error_log('🔍 Calcul des capacités pour ' . $date_debut . ' à ' . $date_fin);
// Récupérer tous les posts 'traduction_langue' publiés et actifs
$capacites_posts = \get_posts([