Index: branches/5.2.x/core/kernel/db/cat_event_handler.php
===================================================================
diff -u -N -r16659 -r16671
--- branches/5.2.x/core/kernel/db/cat_event_handler.php (.../cat_event_handler.php) (revision 16659)
+++ branches/5.2.x/core/kernel/db/cat_event_handler.php (.../cat_event_handler.php) (revision 16671)
@@ -1,6 +1,6 @@
Application->getUnitOption($event->Prefix, 'ItemType');
if (in_array('search', $types) || in_array('search', $except_types)) {
$event_mapping = Array (
@@ -449,7 +450,9 @@
$search_helper = $this->Application->recallObject('SearchHelper');
$search_sql = ' FROM ' . $search_helper->getSearchTable() . ' search_result
- JOIN %1$s ON %1$s.ResourceId = search_result.ResourceId';
+ JOIN %1$s
+ ON %1$s.ResourceId = search_result.ResourceId
+ AND search_result.ItemType = ' . $item_type;
$sql = str_replace('FROM %1$s', $search_sql, $object->GetPlainSelectSQL());
$object->SetSelectSQL($sql);
@@ -475,7 +478,6 @@
}
$rel_table = $this->Application->getUnitOption('rel', 'TableName');
- $item_type = (int)$this->Application->getUnitOption($event->Prefix, 'ItemType');
if ($item_type == 0) {
trigger_error('ItemType not defined for prefix ' . $event->Prefix . '', E_USER_WARNING);