FIX Can't insert if there is extrafields mandatory on another entity.

FIX Can't set default value of extrafield of type varchar
This commit is contained in:
Laurent Destailleur
2019-03-21 11:54:14 +01:00
parent 4c85068a85
commit 032aa869e4
4 changed files with 14 additions and 8 deletions

View File

@@ -1138,7 +1138,7 @@ class DoliDBPgsql extends DoliDB
if ($field_desc['default'] != '')
{
if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int') $sql.=" DEFAULT ".$this->escape($field_desc['default']);
elseif ($field_desc['type'] == 'text') $sql.=" DEFAULT '".$this->escape($field_desc['default'])."'"; // Default not supported on text fields
elseif ($field_desc['type'] != 'text') $sql.=" DEFAULT '".$this->escape($field_desc['default'])."'"; // Default not supported on text fields
}
dol_syslog($sql,LOG_DEBUG);