Index: branches/RC/core/units/categories/categories_event_handler.php =================================================================== diff -u -r11504 -r11523 --- branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 11504) +++ branches/RC/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 11523) @@ -439,9 +439,12 @@ $sql = 'SELECT ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . ' FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . ' WHERE - (NamedParentPath = ' . $this->Conn->qstr($template) . ') OR - (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR - (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ')'; + ( + (NamedParentPath = ' . $this->Conn->qstr($template) . ') OR + (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR + (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ') + ) AND (ThemeId = ' . $this->_getCurrentThemeId() . ' OR ThemeId = 0)'; + $page_id = $this->Conn->GetOne($sql); } else {