Index: branches/unlabeled/unlabeled-1.28.2/core/units/general/cat_dbitem.php =================================================================== diff -u -r5327 -r5467 --- branches/unlabeled/unlabeled-1.28.2/core/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 5327) +++ branches/unlabeled/unlabeled-1.28.2/core/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 5467) @@ -16,6 +16,12 @@ */ var $useFilenames = true; + function Clear() + { + parent::Clear(); + $this->CategoryPath = Array(); + } + function Create($force_id=false, $system_create=false) { if (!$this->Validate()) return false; Index: branches/unlabeled/unlabeled-1.28.2/kernel/units/general/cat_dbitem.php =================================================================== diff -u -r5327 -r5467 --- branches/unlabeled/unlabeled-1.28.2/kernel/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 5327) +++ branches/unlabeled/unlabeled-1.28.2/kernel/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 5467) @@ -16,6 +16,12 @@ */ var $useFilenames = true; + function Clear() + { + parent::Clear(); + $this->CategoryPath = Array(); + } + function Create($force_id=false, $system_create=false) { if (!$this->Validate()) return false; Index: branches/unlabeled/unlabeled-1.4.10/kernel/units/general/helpers/multilanguage.php =================================================================== diff -u -r5183 -r5467 --- branches/unlabeled/unlabeled-1.4.10/kernel/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 5183) +++ branches/unlabeled/unlabeled-1.4.10/kernel/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 5467) @@ -23,6 +23,13 @@ var $curSourceField = false; /** + * Indexes used in table of 32 + * + * @var int + */ + var $curIndexCount = 0; + + /** * Fields from config, that are currently used * * @var Array @@ -71,6 +78,7 @@ if (!getArrayValue($structure_status, $table_name)) { $this->curStructure = $this->Conn->Query('DESCRIBE '.$table_name, 'Field'); + $this->curIndexCount = count($this->Conn->Query('SHOW INDEXES FROM '.$table_name)); $structure_status[$table_name] = true; } } @@ -209,10 +217,11 @@ $field_expression = sprintf($field_mask, $start_index); $ret .= 'ADD COLUMN '.$field_expression.' AFTER `'.$prev_field.'`, '; - if ($start_index == $this->Application->GetDefaultLanguageId() || !$single_lang) { + if ($this->curIndexCount < 32 && ($start_index == $this->Application->GetDefaultLanguageId() || !$single_lang)) { // create index for primary language column + for all others (if multiple languages installed) - list($field_name, $field_params) = explode(' ', $field_expression, 2); - $ret .= 'ADD INDEX (`'.$field_name.'` (5) ), '; + list($field_name, $field_params) = explode(' ', $field_expression, 2); + $ret .= 'ADD INDEX (`'.$field_name.'` (5) ), '; + $this->curIndexCount++; } $start_index++; Index: branches/unlabeled/unlabeled-1.17.2/kernel/units/general/cat_dbitem_export.php =================================================================== diff -u -r5352 -r5467 --- branches/unlabeled/unlabeled-1.17.2/kernel/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 5352) +++ branches/unlabeled/unlabeled-1.17.2/kernel/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 5467) @@ -783,6 +783,10 @@ $item_id = $this->Conn->GetOne($sql); } $save_method = $item_id && $this->curItem->Load($item_id) ? 'Update' : 'Create'; + if ($save_method == 'Update') { + // replace id from csv file with found id + $record_data[ array_search($this->curItem->IDField, $this->exportFields) ] = $item_id; + } } $this->setImportData($record_data); @@ -818,9 +822,13 @@ /*function saveLog($msg) { - $fp = fopen(FULL_PATH.'/sqls.log', 'a'); + static $first_time = true; + + $fp = fopen(FULL_PATH.'/sqls.log', $first_time ? 'w' : 'a'); fwrite($fp, $msg."\n"); fclose($fp); + + $first_time = false; }*/ /** Index: branches/unlabeled/unlabeled-1.4.10/core/units/general/helpers/multilanguage.php =================================================================== diff -u -r5183 -r5467 --- branches/unlabeled/unlabeled-1.4.10/core/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 5183) +++ branches/unlabeled/unlabeled-1.4.10/core/units/general/helpers/multilanguage.php (.../multilanguage.php) (revision 5467) @@ -23,6 +23,13 @@ var $curSourceField = false; /** + * Indexes used in table of 32 + * + * @var int + */ + var $curIndexCount = 0; + + /** * Fields from config, that are currently used * * @var Array @@ -71,6 +78,7 @@ if (!getArrayValue($structure_status, $table_name)) { $this->curStructure = $this->Conn->Query('DESCRIBE '.$table_name, 'Field'); + $this->curIndexCount = count($this->Conn->Query('SHOW INDEXES FROM '.$table_name)); $structure_status[$table_name] = true; } } @@ -209,10 +217,11 @@ $field_expression = sprintf($field_mask, $start_index); $ret .= 'ADD COLUMN '.$field_expression.' AFTER `'.$prev_field.'`, '; - if ($start_index == $this->Application->GetDefaultLanguageId() || !$single_lang) { + if ($this->curIndexCount < 32 && ($start_index == $this->Application->GetDefaultLanguageId() || !$single_lang)) { // create index for primary language column + for all others (if multiple languages installed) - list($field_name, $field_params) = explode(' ', $field_expression, 2); - $ret .= 'ADD INDEX (`'.$field_name.'` (5) ), '; + list($field_name, $field_params) = explode(' ', $field_expression, 2); + $ret .= 'ADD INDEX (`'.$field_name.'` (5) ), '; + $this->curIndexCount++; } $start_index++; Index: branches/unlabeled/unlabeled-1.17.2/core/units/general/cat_dbitem_export.php =================================================================== diff -u -r5352 -r5467 --- branches/unlabeled/unlabeled-1.17.2/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 5352) +++ branches/unlabeled/unlabeled-1.17.2/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 5467) @@ -783,6 +783,10 @@ $item_id = $this->Conn->GetOne($sql); } $save_method = $item_id && $this->curItem->Load($item_id) ? 'Update' : 'Create'; + if ($save_method == 'Update') { + // replace id from csv file with found id + $record_data[ array_search($this->curItem->IDField, $this->exportFields) ] = $item_id; + } } $this->setImportData($record_data); @@ -818,9 +822,13 @@ /*function saveLog($msg) { - $fp = fopen(FULL_PATH.'/sqls.log', 'a'); + static $first_time = true; + + $fp = fopen(FULL_PATH.'/sqls.log', $first_time ? 'w' : 'a'); fwrite($fp, $msg."\n"); fclose($fp); + + $first_time = false; }*/ /** Index: branches/unlabeled/unlabeled-1.106.2/globals.php =================================================================== diff -u -r5401 -r5467 --- branches/unlabeled/unlabeled-1.106.2/globals.php (.../globals.php) (revision 5401) +++ branches/unlabeled/unlabeled-1.106.2/globals.php (.../globals.php) (revision 5467) @@ -1571,6 +1571,7 @@ $sql = 'SELECT imp.* , m.LoadOrder FROM '.TABLE_PREFIX.'ImportScripts imp LEFT JOIN '.TABLE_PREFIX.'Modules m ON m.Name = imp.is_Module + WHERE m.Loaded = 1 ORDER BY m.LoadOrder'; $db =& GetADODBConnection();