summaryrefslogtreecommitdiff
path: root/framework/Data
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Data')
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordGateway.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/framework/Data/ActiveRecord/TActiveRecordGateway.php b/framework/Data/ActiveRecord/TActiveRecordGateway.php
index e588b976..a61ae0ff 100644
--- a/framework/Data/ActiveRecord/TActiveRecordGateway.php
+++ b/framework/Data/ActiveRecord/TActiveRecordGateway.php
@@ -306,7 +306,7 @@ class TActiveRecordGateway extends TComponent
if($column->getIsExcluded())
continue;
$value = $record->getColumnValue($name);
- if(!$column->getAllowNull() && $value===null && !$column->hasSequence() && !$column->getDefaultValue())
+ if(!$column->getAllowNull() && $value===null && !$column->hasSequence() && ($column->getDefaultValue() === TDbTableColumn::UNDEFINED_VALUE))
{
throw new TActiveRecordException(
'ar_value_must_not_be_null', get_class($record),
@@ -342,7 +342,7 @@ class TActiveRecordGateway extends TComponent
if($column->getIsExcluded())
continue;
$value = $record->getColumnValue($name);
- if(!$column->getAllowNull() && $value===null)
+ if(!$column->getAllowNull() && $value===null && ($column->getDefaultValue() === TDbTableColumn::UNDEFINED_VALUE))
{
throw new TActiveRecordException(
'ar_value_must_not_be_null', get_class($record),