Index: branches/unlabeled/unlabeled-1.43.2/admin/install/install_lib.php =================================================================== diff -u -r6038 -r6044 --- branches/unlabeled/unlabeled-1.43.2/admin/install/install_lib.php (.../install_lib.php) (revision 6038) +++ branches/unlabeled/unlabeled-1.43.2/admin/install/install_lib.php (.../install_lib.php) (revision 6044) @@ -1058,6 +1058,15 @@ WHERE ParentPath LIKE "'.$root_parent_path.'%" AND ItemTemplate != "" AND ItemTemplate IS NOT NULL'); foreach ($current_item_tpls as $a_cat) { + $has_cdata = $application->Conn->GetOne( + 'SELECT CustomDataId FROM '.TABLE_PREFIX.'CategoryCustomData + WHERE ResourceId = '.$a_cat['ResourceId']); + + if (!$has_cdata) { + $query = 'INSERT INTO '.TABLE_PREFIX.'CategoryCustomData (ResourceId) VALUES ('.$a_cat['ResourceId'].')'; + $application->Conn->Query($query); + } + $query = 'UPDATE '.TABLE_PREFIX.'CategoryCustomData SET '.$item_t_customfield.' = '.$application->Conn->qstr($a_cat['ItemTemplate']).' WHERE ResourceId = '.$a_cat['ResourceId'];