Index: trunk/kernel/units/custom_fields/custom_fields_event_handler.php =================================================================== diff -u -N -r1566 -r2071 --- trunk/kernel/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 1566) +++ trunk/kernel/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 2071) @@ -13,6 +13,11 @@ $object =& $event->getObject(); $item_type=$this->Application->GetVar('cf_type'); + /*if(!$item_type) + { + $parent_info = $object->getLinkedInfo(); + $item_type = $this->Application->getUnitOption($parent_info['ParentPrefix'], 'ItemType'); + }*/ $object->addFilter('itemtype_filter', '%1$s.Type = '.$item_type); //$object->AddOrderField('DisplayOrder', 'ASC'); } @@ -37,7 +42,7 @@ $object->FieldErrors['FieldName']['pseudo'] = $this->Application->Phrase('la_error_CustomExists'); } else { - $item_type=$this->Application->GetVar('cf_type'); + $item_type = $this->Application->GetVar('cf_type'); $object->SetDBField('Type', $this->Application->GetVar('cf_type')); } Index: trunk/core/units/custom_fields/custom_fields_event_handler.php =================================================================== diff -u -N -r1566 -r2071 --- trunk/core/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 1566) +++ trunk/core/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 2071) @@ -13,6 +13,11 @@ $object =& $event->getObject(); $item_type=$this->Application->GetVar('cf_type'); + /*if(!$item_type) + { + $parent_info = $object->getLinkedInfo(); + $item_type = $this->Application->getUnitOption($parent_info['ParentPrefix'], 'ItemType'); + }*/ $object->addFilter('itemtype_filter', '%1$s.Type = '.$item_type); //$object->AddOrderField('DisplayOrder', 'ASC'); } @@ -37,7 +42,7 @@ $object->FieldErrors['FieldName']['pseudo'] = $this->Application->Phrase('la_error_CustomExists'); } else { - $item_type=$this->Application->GetVar('cf_type'); + $item_type = $this->Application->GetVar('cf_type'); $object->SetDBField('Type', $this->Application->GetVar('cf_type')); } Index: trunk/kernel/units/custom_values/custom_value_event_handler.php =================================================================== diff -u -N -r1795 -r2071 --- trunk/kernel/units/custom_values/custom_value_event_handler.php (.../custom_value_event_handler.php) (revision 1795) +++ trunk/kernel/units/custom_values/custom_value_event_handler.php (.../custom_value_event_handler.php) (revision 2071) @@ -2,13 +2,13 @@ class CustomValuesEventHandler extends InpDBEventHandler { - function SetCustomQuery(&$event) { $object =& $event->getObject(); - $top_prefix = $this->Application->GetTopmostPrefix($event->Prefix); - $item_type = $this->Application->getUnitOption($top_prefix, 'ItemType'); + $parent_info = $object->getLinkedInfo(); + // $top_prefix = $this->Application->GetTopmostPrefix($event->Prefix); + $item_type = $this->Application->getUnitOption($parent_info['ParentPrefix'], 'ItemType'); $item_resource_id = $this->GetParentResourceId($event);