diff --git a/gamuform_fonctions.php b/gamuform_fonctions.php index a7902ae..d5518b3 100644 --- a/gamuform_fonctions.php +++ b/gamuform_fonctions.php @@ -89,11 +89,17 @@ function gamuform_recup_tableau_objet(string $objet, bool $all = true):array { $T = array_filter($T, function($d){ return !empty($d); }); + $options = []; + if (!empty($T['options'])) { + $options = $T['options']; + unset($T['options']); + } if (!$all) { $T = array_filter($T, function($d){ return !empty($d['saisie']); }); + $T = array_merge(['options' => $options], $T); } return $T; } @@ -154,16 +160,17 @@ function gamuform_recup_champs_gamutable(string $objet):array { */ function gamuform_recup_champs_saisies(string $objet):array { $c = []; - if (gamuform_objet_autoriser($objet)) { $T = gamuform_recup_tableau_objet($objet, false); + if (array_key_exists('options', $T)) { + unset($T['options']); + } if (!empty($T)) { foreach ($T as $s) { $c[] = $s['options']['nom']; } } } - return $c; }