Index: branches/5.3.x/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r16532 -r16600 --- branches/5.3.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 16532) +++ branches/5.3.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 16600) @@ -1,6 +1,6 @@ setEventParam('top_prefix', $this->Application->GetTopmostPrefix($event->Prefix, true)); $status_checked = false; - if ( $user_id == USER_ROOT || $this->CheckPermission($event) ) { - // don't autoload item, when user doesn't have view permission + if ( $this->Application->permissionCheckingDisabled($user_id) || $this->CheckPermission($event) ) { + // Don't autoload item, when user doesn't have view permission. $this->LoadItem($event); $status_checked = true; $editing_mode = defined('EDITING_MODE') ? EDITING_MODE : false; $id_from_request = $event->getEventParam(kEvent::FLAG_ID_FROM_REQUEST); - if ( $user_id != USER_ROOT + if ( !$this->Application->permissionCheckingDisabled($user_id) && !$this->Application->isAdmin && !($editing_mode || ($id_from_request ? $this->checkItemStatus($event) : true)) ) { - // non-root user AND on front-end AND (not editing mode || incorrect status) + // Permissions are being checked AND on Front-End AND (not editing mode || incorrect status). $perm_status = false; } } @@ -1602,6 +1602,10 @@ $this->_update($event); $event->SetRedirectParam('opener', 'u'); + + if ( $event->status == kEvent::erSUCCESS ) { + $this->saveChangesToLiveTable($event->Prefix); + } } /** @@ -1639,6 +1643,26 @@ } /** + * Automatically saves data to live table after sub-item was updated in Content Mode. + * + * @param string $prefix Prefix. + * + * @return void + */ + protected function saveChangesToLiveTable($prefix) + { + $parent_prefix = $this->Application->getUnitConfig($prefix)->getParentPrefix(); + + if ( $parent_prefix === false ) { + return; + } + + if ( $this->Application->GetVar('admin') && $this->Application->IsTempMode($parent_prefix) ) { + $this->Application->HandleEvent(new kEvent($parent_prefix . ':OnSave')); + } + } + + /** * Delete's kDBItem object * * @param kEvent $event