From 0111fc1aba307ce1985f4a4f2cca186a83e48acc Mon Sep 17 00:00:00 2001 From: tofulm Date: Thu, 21 Apr 2022 17:31:54 +0200 Subject: [PATCH] filtrage pour eviter une erreur si une autorisation ne permet pas d'utiliser un champ --- gamuform_fonctions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gamuform_fonctions.php b/gamuform_fonctions.php index 64feb0e..33598cd 100644 --- a/gamuform_fonctions.php +++ b/gamuform_fonctions.php @@ -62,6 +62,11 @@ function gamuform_recup_tableau_objet(string $objet, bool $all = true):array { if (empty($T)) { $T = []; } + // on filtre les entrées vides, qui peuvent arriver si on on des autorisations + $T = array_filter($T, function($d){ + return !empty($d); + }); + if (!$all) { $T = array_filter($T, function($d){ return !empty($d['saisie']);