Index: trunk/core/units/general/cat_dbitem_export.php =================================================================== diff -u -r3698 -r3709 --- trunk/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 3698) +++ trunk/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 3709) @@ -389,6 +389,7 @@ $records = $this->Conn->Query( $this->getExportSQL() ); $records_exported = 0; foreach ($records as $record_info) { + $this->curItem->Clear(); $this->curItem->SetDBFieldsFromHash($record_info); $this->setCurrentID(); $this->curItem->raiseEvent('OnAfterItemLoad', $this->curItem->GetID() ); @@ -630,7 +631,7 @@ WHERE (c.ParentPath LIKE "'.$parent_path.'%") AND '.$where_clause; $item_id = $this->Conn->GetOne($sql); } - $save_method = $tmp_item->Load($item_id) ? 'Update' : 'Create'; + $save_method = $item_id && $tmp_item->Load($item_id) ? 'Update' : 'Create'; } $resource_id = $tmp_item->isLoaded() ? $tmp_item->GetDBField('ResourceId') : 0;