From c373d5d576cdd332526c74c07e0528e99909a60a Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 23 Dec 2018 21:04:54 +0100 Subject: [PATCH 1/2] PHP 7.2 : sizeof attribut --- include/class/fiche.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php index a69db88b2..3f44dc7bc 100644 --- a/include/class/fiche.class.php +++ b/include/class/fiche.class.php @@ -345,7 +345,7 @@ class Fiche function strAttribut($p_ad_id,$p_return=1) { $return=($p_return==1)?NOTFOUND:""; - if ( sizeof ($this->attribut) == 0 ) + if ( $this->attribut == NULL ) { if ($this->id==0) { From 3f53de417dd89e9a90a386404f93f8648155e046 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 25 Dec 2018 23:19:36 +0100 Subject: [PATCH 2/2] gitlab #3 Manage Table issue with the type SELECT, cannot reproduce bug Back to old version to fix issue with the type "SELECT" from the menu Syndicat.tools->section --- include/lib/manage_table_sql.class.php | 33 ++++++++++++-------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/include/lib/manage_table_sql.class.php b/include/lib/manage_table_sql.class.php index 87427d300..51aef220c 100644 --- a/include/lib/manage_table_sql.class.php +++ b/include/lib/manage_table_sql.class.php @@ -810,27 +810,24 @@ function check() * we translate the code from the database into a hardcoded label */ $idx=$p_row[$v]; - if ( ! isset($this->a_select[$v][$idx])) { - /* - * Check if index exists - */ - $array_to_search=$this->a_select[$v]; - $value=$p_row[$v]; - $nb_search=count($array_to_search); - $found=FALSE; - for ( $e=0;$e< $nb_search;$e++) { - if (isset ($array_to_search[$e]['value']) && $array_to_search[$e]['value']==$value ) { - $found=TRUE; - echo td($array_to_search[$e]['label']); - } + /* + * Check if index exists + */ + $array_to_search=$this->a_select[$v]; + $value=$p_row[$v]; + + $nb_search=(is_array($array_to_search))?count($array_to_search):0; + $found=FALSE; + for ( $e=0;$e< $nb_search;$e++) { + if (isset ($array_to_search[$e]['value']) && $array_to_search[$e]['value']==$value ) { + $found=TRUE; + echo td($array_to_search[$e]['label']); } + } - if ( ! $found) { - echo td("--"); + if ( ! $found) { + echo td("--"); - } - } else { - echo td($this->a_select[$v][$idx]["label"]); } }else {