fix warnings

This commit is contained in:
Frédéric FRANCE 2021-05-27 23:11:05 +02:00 committed by GitHub
parent 819e6e1122
commit ca0654323f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6397,7 +6397,7 @@ abstract class CommonObject
$param = array(); $param = array();
$param['options'] = array(); $param['options'] = array();
$reg = array(); $reg = array();
$size = $this->fields[$key]['size']; $size = !empty($this->fields[$key]['size']) ? $this->fields[$key]['size'] : 0;
// Because we work on extrafields // Because we work on extrafields
if (preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { if (preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) {
$param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N');
@ -6430,21 +6430,21 @@ abstract class CommonObject
} }
// Special case that force options and type ($type can be integer, varchar, ...) // Special case that force options and type ($type can be integer, varchar, ...)
if (is_array($this->fields[$key]['arrayofkeyval'])) { if (!empty($this->fields[$key]['arrayofkeyval']) && is_array($this->fields[$key]['arrayofkeyval'])) {
$param['options'] = $this->fields[$key]['arrayofkeyval']; $param['options'] = $this->fields[$key]['arrayofkeyval'];
$type = 'select'; $type = 'select';
} }
$label = $this->fields[$key]['label']; $label = $this->fields[$key]['label'];
//$elementtype=$this->fields[$key]['elementtype']; // Seems not used //$elementtype=$this->fields[$key]['elementtype']; // Seems not used
$default = $this->fields[$key]['default']; $default = (!empty($this->fields[$key]['default']) ? $this->fields[$key]['default'] : '');
$computed = $this->fields[$key]['computed']; $computed = (!empty($this->fields[$key]['computed']) ? $this->fields[$key]['computed'] : '');
$unique = $this->fields[$key]['unique']; $unique = (!empty($this->fields[$key]['unique']) ? $this->fields[$key]['unique'] : 0);
$required = $this->fields[$key]['required']; $required = (!empty($this->fields[$key]['required']) ? $this->fields[$key]['required'] : 0);
$autofocusoncreate = $this->fields[$key]['autofocusoncreate']; $autofocusoncreate = (!empty($this->fields[$key]['autofocusoncreate']) ? $this->fields[$key]['autofocusoncreate'] : 0);
$langfile = $this->fields[$key]['langfile']; $langfile = (!empty($this->fields[$key]['langfile']) ? $this->fields[$key]['langfile'] : '');
$list = $this->fields[$key]['list']; $list = (!empty($this->fields[$key]['list']) ? $this->fields[$key]['list'] : 0);
$hidden = (in_array(abs($this->fields[$key]['visible']), array(0, 2)) ? 1 : 0); $hidden = (in_array(abs($this->fields[$key]['visible']), array(0, 2)) ? 1 : 0);
$objectid = $this->id; $objectid = $this->id;