Fix price2num needs lang loaded when it may not exists
This commit is contained in:
parent
917c8df225
commit
c0abb725cb
@ -7260,9 +7260,11 @@ abstract class CommonObject
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to prepare the values to insert.
|
* Function to prepare a part of the query for insert.
|
||||||
* Note $this->${field} are set by the page that make the createCommon or the updateCommon.
|
* Note $this->${field} are set by the page that make the createCommon or the updateCommon.
|
||||||
|
* $this->${field} should be a clean value. The page can run
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
@ -7301,13 +7303,13 @@ abstract class CommonObject
|
|||||||
if ($field == 'entity' && is_null($this->{$field})) $queryarray[$field]=$conf->entity;
|
if ($field == 'entity' && is_null($this->{$field})) $queryarray[$field]=$conf->entity;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$queryarray[$field] = (int) price2num($this->{$field});
|
$queryarray[$field] = (int) $this->{$field};
|
||||||
if (empty($queryarray[$field])) $queryarray[$field]=0; // May be reset to null later if property 'notnull' is -1 for this field.
|
if (empty($queryarray[$field])) $queryarray[$field]=0; // May be reset to null later if property 'notnull' is -1 for this field.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($this->isFloat($info))
|
elseif($this->isFloat($info))
|
||||||
{
|
{
|
||||||
$queryarray[$field] = (double) price2num($this->{$field});
|
$queryarray[$field] = (double) $this->{$field};
|
||||||
if (empty($queryarray[$field])) $queryarray[$field]=0;
|
if (empty($queryarray[$field])) $queryarray[$field]=0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user