Index: branches/RC/core/units/general/cat_event_handler.php =================================================================== diff -u -r10643 -r10671 --- branches/RC/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 10643) +++ branches/RC/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 10671) @@ -327,8 +327,36 @@ $rel_table = $this->Application->getUnitOption('rel', 'TableName'); $item_type = $this->Application->getUnitOption($event->Prefix, 'ItemType'); + // process case, then this list is called inside another list + $prefix_special = $event->getEventParam('PrefixSpecial'); + if (!$prefix_special) { + $prefix_special = $this->Application->Parser->GetParam('PrefixSpecial'); + } + + $id = false; + if ($prefix_special !== false) { + $processed_prefix = $this->Application->processPrefix($prefix_special); + if ($processed_prefix['prefix'] == $related_prefix) { + // printing related categories within list of items (not on details page) + $list =& $this->Application->recallObject($prefix_special); + /* @var $list kDBList */ + + $id = $list->GetID(); + } + } + + if ($id === false) { + // printing related categories for single item (possibly on details page) + if ($related_prefix == 'c') { + $id = $this->Application->GetVar('m_cat_id'); + } + else { + $id = $this->Application->GetVar($related_prefix . '_id'); + } + } + $p_item =& $this->Application->recallObject($related_prefix.'.current', null, Array('skip_autoload' => true)); - $p_item->Load( $this->Application->GetVar($related_prefix.'_id') ); + $p_item->Load( (int)$id ); $p_resource_id = $p_item->GetDBField('ResourceId');