Index: branches/unlabeled/unlabeled-1.43.2/core/kernel/db/db_event_handler.php =================================================================== diff -u -r4230 -r4278 --- branches/unlabeled/unlabeled-1.43.2/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 4230) +++ branches/unlabeled/unlabeled-1.43.2/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 4278) @@ -1580,15 +1580,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; }