Index: trunk/core/kernel/db/db_event_handler.php =================================================================== diff -u -r4325 -r4358 --- trunk/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 4325) +++ trunk/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 4358) @@ -1603,15 +1603,20 @@ function OnCreateCustomFields(&$event) { $main_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix'); + $item_type = $this->Application->getUnitOption($main_prefix, 'ItemType'); + if (!$item_type) { + // no main config of such type + return false; + } // 1. get custom field information - $item_type = $this->Application->getUnitOption($main_prefix, 'ItemType'); $sql = 'SELECT FieldName, CustomFieldId FROM '.TABLE_PREFIX.'CustomField WHERE Type = '.$item_type.' ORDER BY CustomFieldId'; $custom_fields = $this->Conn->GetCol($sql, 'CustomFieldId'); if (!$custom_fields) { + // config doesn't have custom fields return false; }