Update for 'Suppress DB updates when values are not changed'

This commit is contained in:
Deon George 2016-08-03 14:04:39 +10:00
parent e3bfa19f3d
commit fd134e7f87

View File

@ -812,7 +812,7 @@ class Kohana_ORM extends Model implements serializable {
// If the replacement value is the same as the original value, we dont need to update.
// @note This assumes that the value returned from the DB is always a string.
if (array_key_exists($column, $this->_original_values) AND (string)$value === $this->_original_values[$column] AND array_key_exists($column, $this->_changed))
if (array_key_exists($column, $this->_original_values) AND is_string($value) AND (string)$value === $this->_original_values[$column] AND array_key_exists($column, $this->_changed))
{
unset($this->_changed[$column]);