Index: branches/unlabeled/unlabeled-1.82.2/core/kernel/db/db_event_handler.php =================================================================== diff -u -r7842 -r7874 --- branches/unlabeled/unlabeled-1.82.2/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 7842) +++ branches/unlabeled/unlabeled-1.82.2/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 7874) @@ -910,10 +910,10 @@ function OnCreate(&$event) { $object =& $event->getObject( Array('skip_autoload' => true) ); - /* @var $object kDBItem */ $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); - if ($items_info) { + if($items_info) + { list($id,$field_values) = each($items_info); $object->SetFieldsFromHash($field_values); } @@ -1782,10 +1782,6 @@ */ function OnCreateCustomFields(&$event) { - if (defined('IS_INSTALL') && IS_INSTALL && !$this->Application->TableFound('CustomField')) { - return false; - } - $main_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix'); if (!$main_prefix) return false; $item_type = $this->Application->getUnitOption($main_prefix, 'ItemType'); @@ -1807,7 +1803,7 @@ // 2. create fields (for customdata item) $fields = $this->Application->getUnitOption($event->Prefix, 'Fields', Array()); - $field_options = Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'db_type' => 'text', 'default' => ''); + $field_options = Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'db_type' => 'text', 'default' => ''); foreach ($custom_fields as $custom_id => $custom_params) { if (isset($fields['cust_'.$custom_id])) continue; $fields['cust_'.$custom_id] = $field_options;