From 64ebbec96624bba093b1a91e867471ef49cfd384 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Sep 2019 03:43:24 +0200 Subject: [PATCH] Fix deprecated code --- htdocs/adherents/type.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 0c32e33164d..55598c196ee 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -812,21 +812,24 @@ if ($rowid > 0) if (empty($reshook)) { print '

'; - foreach($extrafields->attribute_label as $key=>$label) + if (is_array($extrafields->attributes['adherent_type']['label'])) { - if (isset($_POST["options_" . $key])) { - if (is_array($_POST["options_" . $key])) { - // $_POST["options"] is an array but following code expects a comma separated string - $value = implode(",", $_POST["options_" . $key]); + foreach($extrafields->attributes['adherent_type']['label'] as $key=>$label) + { + if (isset($_POST["options_" . $key])) { + if (is_array($_POST["options_" . $key])) { + // $_POST["options"] is an array but following code expects a comma separated string + $value = implode(",", $_POST["options_" . $key]); + } else { + $value = $_POST["options_" . $key]; + } } else { - $value = $_POST["options_" . $key]; + $value = $object->array_options["options_" . $key]; } - } else { - $value = $adht->array_options["options_" . $key]; + print '\n"; } - print '\n"; } print '
'.$label.''; + print $extrafields->showInputField($key, $value); + print "
'.$label.''; - print $extrafields->showInputField($key, $value); - print "


'; }