Allow "smallint" values to store 0 in MySQL db without conversion to NULL
It was an issue with ConferenceOrBoothAttendee instances
This commit is contained in:
parent
195b9f5ebc
commit
d8fa7d84cc
@ -8675,7 +8675,7 @@ abstract class CommonObject
|
|||||||
public function isInt($info)
|
public function isInt($info)
|
||||||
{
|
{
|
||||||
if (is_array($info)) {
|
if (is_array($info)) {
|
||||||
if (isset($info['type']) && ($info['type'] == 'int' || preg_match('/^integer/i', $info['type']))) {
|
if (isset($info['type']) && (preg_match('/(^int|int$)/i', $info['type']))) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@ -8934,6 +8934,8 @@ abstract class CommonObject
|
|||||||
return 'NULL';
|
return 'NULL';
|
||||||
} elseif (preg_match('/^(int|double|real|price)/i', $fieldsentry['type'])) {
|
} elseif (preg_match('/^(int|double|real|price)/i', $fieldsentry['type'])) {
|
||||||
return price2num("$value");
|
return price2num("$value");
|
||||||
|
} else if (preg_match('/int$/i', $fieldsentry['type'])) {
|
||||||
|
return (int)$value;
|
||||||
} elseif ($fieldsentry['type'] == 'boolean') {
|
} elseif ($fieldsentry['type'] == 'boolean') {
|
||||||
if ($value) {
|
if ($value) {
|
||||||
return 'true';
|
return 'true';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user