Fix issue: custom fields not getting saved in mysql v5.7
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
namespace Classes;
|
namespace Classes;
|
||||||
|
|
||||||
use Metadata\Common\Model\CustomFieldValue;
|
use Metadata\Common\Model\CustomFieldValue;
|
||||||
|
use Utils\LogManager;
|
||||||
|
|
||||||
class CustomFieldManager
|
class CustomFieldManager
|
||||||
{
|
{
|
||||||
@@ -28,12 +29,17 @@ class CustomFieldManager
|
|||||||
$customFieldValue->name = $name;
|
$customFieldValue->name = $name;
|
||||||
$customFieldValue->object_id = $id;
|
$customFieldValue->object_id = $id;
|
||||||
$customFieldValue->type = $type;
|
$customFieldValue->type = $type;
|
||||||
$customFieldValue->created = date("Y-md-d H:i:s");
|
$customFieldValue->created = date("Y-m-d H:i:s");
|
||||||
}
|
}
|
||||||
|
|
||||||
$customFieldValue->value = $value;
|
$customFieldValue->value = $value;
|
||||||
$customFieldValue->updated = date("Y-md-d H:i:s");
|
$customFieldValue->updated = date("Y-m-d H:i:s");
|
||||||
$customFieldValue->Save();
|
$ok = $customFieldValue->Save();
|
||||||
|
if (!$ok) {
|
||||||
|
LogManager::getInstance()->error("Error saving custom field: " . $customFieldValue->ErrorMsg());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCustomFields($type, $id)
|
public function getCustomFields($type, $id)
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ class BaseModel extends \ADOdb_Active_Record
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$keys[$k] = $k;
|
$keys[$k] = $v;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $keys;
|
return $keys;
|
||||||
|
|||||||
Reference in New Issue
Block a user