mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
FIX: modulebuilder: handle 'price' fieldtype
This commit is contained in:
@@ -63,7 +63,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Label")), null, 'errors');
|
||||
return -2;
|
||||
}
|
||||
if (! preg_match('/^(integer|date|timestamp|varchar|double|html)/', $addfieldentry['type']))
|
||||
if (! preg_match('/^(integer|date|timestamp|varchar|double|html|price)/', $addfieldentry['type']))
|
||||
{
|
||||
setEventMessages($langs->trans('BadFormatForType', $objectname), null, 'errors');
|
||||
return -2;
|
||||
@@ -257,6 +257,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='',
|
||||
$type = $val['type'];
|
||||
$type = preg_replace('/:.*$/', '', $type); // For case type = 'integer:Societe:societe/class/societe.class.php'
|
||||
if ($type == 'html') $type = 'text'; // html modulebuilder type is a text type in database
|
||||
if ($type == 'price') $type = 'double'; // html modulebuilder type is a text type in database
|
||||
$texttoinsert.= "\t".$key." ".$type;
|
||||
if ($key == 'rowid') $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY';
|
||||
if ($key == 'entity') $texttoinsert.= ' DEFAULT 1';
|
||||
|
||||
Reference in New Issue
Block a user