Index: branches/5.1.x/core/kernel/db/cat_dbitem.php =================================================================== diff -u -N -r13545 -r13811 --- branches/5.1.x/core/kernel/db/cat_dbitem.php (.../cat_dbitem.php) (revision 13545) +++ branches/5.1.x/core/kernel/db/cat_dbitem.php (.../cat_dbitem.php) (revision 13811) @@ -1,6 +1,6 @@ VirtualFields['ResourceId'] = Array(); - $this->SetDBField('Modified', adodb_mktime() ); - $this->UpdateFormattersSubFields(array('Modified')); - $this->SetDBField('ModifiedById', $this->Application->RecallVar('user_id')); + if ($this->GetChangedFields()) { + $now = adodb_mktime(); + $this->SetDBField('Modified_date', $now); + $this->SetDBField('Modified_time', $now); + $this->SetDBField('ModifiedById', $this->Application->RecallVar('user_id')); + } + if ($this->useFilenames) { $this->checkFilename(); $this->generateFilename(); Index: branches/5.1.x/core/units/categories/categories_event_handler.php =================================================================== diff -u -N -r13581 -r13811 --- branches/5.1.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 13581) +++ branches/5.1.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 13811) @@ -1,6 +1,6 @@ getObject(); /* @var $object kDBItem */ - $object->SetDBField('ModifiedById', $this->Application->RecallVar('user_id')); + if ($object->GetChangedFields()) { + $object->SetDBField('ModifiedById', $this->Application->RecallVar('user_id')); + } $this->_beforeItemChange($event); } @@ -1556,8 +1558,10 @@ $now = adodb_mktime(); - $object->SetDBField('Modified_date', $now); - $object->SetDBField('Modified_time', $now); + if ($object->GetChangedFields()) { + $object->SetDBField('Modified_date', $now); + $object->SetDBField('Modified_time', $now); + } $object->setRequired('PageCacheKey', $object->GetDBField('OverridePageCacheKey')); $object->SetDBField('Template', $this->_stripTemplateExtension( $object->GetDBField('Template') )); Index: branches/5.1.x/core/install/upgrades.sql =================================================================== diff -u -N -r13789 -r13811 --- branches/5.1.x/core/install/upgrades.sql (.../upgrades.sql) (revision 13789) +++ branches/5.1.x/core/install/upgrades.sql (.../upgrades.sql) (revision 13811) @@ -1922,3 +1922,6 @@ UPDATE ConfigurationValues SET DisplayOrder = DisplayOrder - 0.01 WHERE ModuleOwner = 'In-Portal' AND `Section` = 'in-portal:configure_categories' AND DisplayOrder > 10.07; + +# ===== v 5.1.0 ===== +UPDATE Events SET Headers = NULL WHERE Headers = ''; Index: branches/5.1.x/core/units/helpers/email_message_helper.php =================================================================== diff -u -N -r13276 -r13811 --- branches/5.1.x/core/units/helpers/email_message_helper.php (.../email_message_helper.php) (revision 13276) +++ branches/5.1.x/core/units/helpers/email_message_helper.php (.../email_message_helper.php) (revision 13811) @@ -28,7 +28,7 @@ } } - $ret['Headers'] = implode("\n", $headers); + $ret['Headers'] = $headers ? implode("\n", $headers) : null; // it's null field $lines = array_slice($lines, $line_id + 1);