Merge pull request #16762 from hregis/fix_avoid_warnin_php_8

FIX avoid warning with php 8
This commit is contained in:
Laurent Destailleur 2021-03-17 16:49:55 +01:00 committed by GitHub
commit f1bc296b6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -264,7 +264,7 @@ class DefaultValues extends CommonObject
foreach ($filter as $key => $value) {
if ($key == 't.rowid' || ($key == 't.entity' && !is_array($value)) || ($key == 't.user_id' && !is_array($value))) {
$sqlwhere[] = $key.'='.$value;
} elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) {
} elseif (isset($this->fields[$key]) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) {
$sqlwhere[] = $key.' = \''.$this->db->idate($value).'\'';
} elseif ($key == 't.page' || $key == 't.param' || $key == 't.type') {
$sqlwhere[] = $key.' = \''.$this->db->escape($value).'\'';