summaryrefslogtreecommitdiffstats
path: root/migrate.module
diff options
context:
space:
mode:
authorMike Ryan2009-09-19 16:03:55 +0000
committerMike Ryan2009-09-19 16:03:55 +0000
commitca523961b6d10cadc03ab609540c2d14220b0ead (patch)
treeb6f35e69f4873756f51e4a63330a31ba2acb300f /migrate.module
parentf56fff91a36444cab5337819df8ac2ccc33df4ce (diff)
Quick fix to bug introduced yesterday - importing flag not cleared
Diffstat (limited to 'migrate.module')
-rwxr-xr-xmigrate.module23
1 files changed, 10 insertions, 13 deletions
diff --git a/migrate.module b/migrate.module
index 2d279b4..cc670c3 100755
--- a/migrate.module
+++ b/migrate.module
@@ -674,17 +674,9 @@ function migrate_content_process_import($mcsid, &$messages = array(), &$options
if ($status == MIGRATE_STATUS_SUCCESS) {
// Remember we're done
if ($importing) {
- db_query("UPDATE {migrate_content_sets}
- SET importing=0, lastimported=NOW()
- WHERE mcsid=%d",
- $mcsid);
- }
- else {
- db_query("UPDATE {migrate_content_sets}
- SET lastimported=NOW()
- WHERE mcsid=%d",
- $mcsid);
+ $tblinfo->importing = 0;
}
+ $tblinfo->lastimported = date('Y-m-d H:i:s');
}
if (isset($feedback)) {
$feedback($message);
@@ -1148,9 +1140,14 @@ function _migrate_xlat_get_new_id($contenttype, $oldid) {
WHERE contenttype='%s'",
$contenttype);
while ($row = db_fetch_object($result)) {
- $table = migrate_map_table_name($row->mcsid);
- $id = db_result(db_query("SELECT destid
- FROM {$table} WHERE sourceid=%d", $oldid));
+ static $maptables = array();
+ if (!isset($maptables[$row->mcsid])) {
+ $maptables[$row->mcsid] = migrate_map_table_name($row->mcsid);
+ }
+ $sql = "SELECT destid
+ FROM {" . $maptables[$row->mcsid] . "}
+ WHERE sourceid='%s'";
+ $id = db_result(db_query($sql, $oldid));
if ($id) {
return $id;
}