2
0
forked from Wavyzz/dolibarr

Fix: validate of object is ok even if some fields are missing

This commit is contained in:
Laurent Destailleur
2020-04-03 14:56:15 +02:00
parent f7b6895dc6
commit a13287e285
4 changed files with 53 additions and 14 deletions

View File

@@ -127,10 +127,10 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
{
$i++;
$texttoinsert .= "\t\t'".$key."' => array('type'=>'".$val['type']."', 'label'=>'".$val['label']."',";
$texttoinsert .= " 'enabled'=>".($val['enabled'] != '' ? $val['enabled'] : 1).",";
$texttoinsert .= " 'position'=>".($val['position'] != '' ? $val['position'] : 50).",";
$texttoinsert .= " 'enabled'=>".($val['enabled'] !== '' ? $val['enabled'] : 1).",";
$texttoinsert .= " 'position'=>".($val['position'] !== '' ? $val['position'] : 50).",";
$texttoinsert .= " 'notnull'=>".(empty($val['notnull']) ? 0 : $val['notnull']).",";
$texttoinsert .= " 'visible'=>".($val['visible'] != '' ? $val['visible'] : -1).",";
$texttoinsert .= " 'visible'=>".($val['visible'] !== '' ? $val['visible'] : -1).",";
if ($val['noteditable']) $texttoinsert .= " 'noteditable'=>'".$val['noteditable']."',";
if ($val['default']) $texttoinsert .= " 'default'=>'".$val['default']."',";
if ($val['index']) $texttoinsert .= " 'index'=>".$val['index'].",";