[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 01/11: For 7.2 , $p_value must be initialized
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 01/11: For 7.2 , $p_value must be initialized to an array in ISelect |
Date: |
Fri, 18 Jan 2019 12:24:26 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 63230cce792d63cc953d4b51c80749d7835d3294
Author: Dany De Bontridder <address@hidden>
Date: Thu Oct 11 20:04:25 2018 +0200
For 7.2 , $p_value must be initialized to an array in ISelect
---
include/lib/iselect.class.php | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/include/lib/iselect.class.php b/include/lib/iselect.class.php
index 2008735..1a91055 100644
--- a/include/lib/iselect.class.php
+++ b/include/lib/iselect.class.php
@@ -29,6 +29,17 @@
require_once NOALYSS_INCLUDE.'/lib/html_input.class.php';
class ISelect extends HtmlInput
{
+ function __construct($p_name="", $p_value="", $p_id="")
+ {
+ parent::__construct($p_name,$p_value,$p_id);
+ $this->name=$p_name;
+ if ( $p_value == "" || ! is_array($p_value)) {
+ $this->value=array();
+ } else {
+ $this->value=$p_value;
+ }
+ $this->id=$p_id;
+ }
/*!\brief show the html input of the widget*/
public function input($p_name=null,$p_value=null)
{
@@ -69,7 +80,7 @@ class ISelect extends HtmlInput
}
}
// $r='<span class="input_text_ro">'.$r.'</span>';
- if ( $this->table == 1 ) $a='<td>'.$r.'</td>';
+ if ( $this->table == 1 ) $r='<td>'.$r.'</td>';
return $r;
}
/*!\brief print in html the readonly value of the widget*/
@@ -96,11 +107,10 @@ class ISelect extends HtmlInput
* // will be turned into
* array( array("value"=>'M,"label"=>"Mister")...)
* @endcode
- * @param type $p_array
- * @return type
+ * @param array $p_array
*/
public function transform($p_array) {
- if (count($p_array)==0) return array();
+ if (! is_array($p_array) || count($p_array)==0) return ;
$a_ret=array();
foreach ($p_array as $key=>$value) {
$a_ret['value']=$key;
- [Noalyss-commit] [noalyss] branch master updated (0de24ee -> 1971f32), Dany De Bontridder, 2019/01/18
- [Noalyss-commit] [noalyss] 02/11: remove dead code, Dany De Bontridder, 2019/01/18
- [Noalyss-commit] [noalyss] 03/11: Merge branch 'master' of gitlab.noalyss.eu:noalyss/noalyss, Dany De Bontridder, 2019/01/18
- [Noalyss-commit] [noalyss] 04/11: Task #1660 : place the button for the inventory on the top, Dany De Bontridder, 2019/01/18
- [Noalyss-commit] [noalyss] 01/11: For 7.2 , $p_value must be initialized to an array in ISelect,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 11/11: Translation, Dany De Bontridder, 2019/01/18
- [Noalyss-commit] [noalyss] 07/11: by default jrn is an empty array, Dany De Bontridder, 2019/01/18
- [Noalyss-commit] [noalyss] 10/11: Translation, Dany De Bontridder, 2019/01/18
- [Noalyss-commit] [noalyss] 05/11: New function findSide return D if number is <0, Dany De Bontridder, 2019/01/18
- [Noalyss-commit] [noalyss] 06/11: Fix problem with total in balance export, Dany De Bontridder, 2019/01/18
- [Noalyss-commit] [noalyss] 09/11: Translation + use of httpInput, Dany De Bontridder, 2019/01/18
- [Noalyss-commit] [noalyss] 08/11: Task #0001309: Association d'une opération avec elle-même., Dany De Bontridder, 2019/01/18