Index: branches/5.2.x/core/kernel/application.php =================================================================== diff -u -r13840 -r14092 --- branches/5.2.x/core/kernel/application.php (.../application.php) (revision 13840) +++ branches/5.2.x/core/kernel/application.php (.../application.php) (revision 14092) @@ -1,6 +1,6 @@ isCachingType(CACHING_TYPE_MEMORY)) { - if (defined('DEBUG_MODE') && DEBUG_MODE && $this->isDebugMode()) { - $this->Application->Debugger->appendHTML('Incrementing serial: ' . $serial_name . '.'); - } - - $this->setCache($serial_name, (int)$this->getCache($serial_name) + 1); + if (defined('DEBUG_MODE') && DEBUG_MODE && $this->isDebugMode()) { + $this->Application->Debugger->appendHTML('Incrementing serial: ' . $serial_name . '.'); } + $this->setCache($serial_name, (int)$this->getCache($serial_name) + 1); + if (!defined('IS_INSTALL') || !IS_INSTALL) { // delete cached mod-rewrite urls related to given prefix and id $delete_clause = isset($id) ? $prefix . ':' . $id : $prefix; @@ -1041,7 +1039,7 @@ $perm_helper =& $this->recallObject('PermissionsHelper'); /* @var $perm_helper kPermissionsHelper */ - if ($perm_helper->CheckUserPermission($user, 'CATEGORY.MODIFY', 0, $this->ModuleInfo['Core']['RootCat'])) { + if ($perm_helper->CheckUserPermission($user, 'CATEGORY.MODIFY', 0, $this->getBaseCategory())) { // user can edit cms blocks $editing_mode = $this->GetVar('editing_mode'); define('EDITING_MODE', $editing_mode ? $editing_mode : EDITING_MODE_BROWSE); @@ -2152,7 +2150,13 @@ if ($this->isDebugMode() && (constOn('DBG_REDIRECT') || (constOn('DBG_RAISE_ON_WARNINGS') && $this->Application->Debugger->WarningCount))) { $this->Debugger->appendTrace(); - echo "Debug output above!!! Proceed to redirect: $location
"; + echo 'Debug output above !!!
' . "\n"; + + if ( array_key_exists('HTTP_REFERER', $_SERVER) ) { + echo 'Referer: ' . $_SERVER['HTTP_REFERER'] . '
' . "\n"; + } + + echo "Proceed to redirect: {$location}
\n"; } else { if ($js_redirect) { @@ -3228,4 +3232,18 @@ return false; } + /** + * Base category of all categories + * Usually replaced category, with ID = 0 in category-related operations. + * + * @return int + */ + function getBaseCategory() + { + // same, what $this->findModule('Name', 'Core', 'RootCat') does + // don't cache while IS_INSTALL, because of kInstallToolkit::createModuleCategory and upgrade + + return $this->ModuleInfo['Core']['RootCat']; + } + } \ No newline at end of file