diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-02-08 15:38:59 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-02-08 15:38:59 -0800 |
commit | 9ca521c71021b43f13950d246a15f6f0da0b7989 (patch) | |
tree | b2435238db3231761efc9245c4627214c9c595db /modules/g2_import/helpers/g2_import_task.php | |
parent | 6dfab72922bf20104d6032eb292d59c6bd6578ba (diff) | |
parent | 008174859dc25dade593abdf4ce670bc6c7ef332 (diff) |
Merge branch 'master' of github.com:gallery/gallery3
Diffstat (limited to 'modules/g2_import/helpers/g2_import_task.php')
-rw-r--r-- | modules/g2_import/helpers/g2_import_task.php | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/modules/g2_import/helpers/g2_import_task.php b/modules/g2_import/helpers/g2_import_task.php index 1ec6870e..b1179e22 100644 --- a/modules/g2_import/helpers/g2_import_task.php +++ b/modules/g2_import/helpers/g2_import_task.php @@ -73,13 +73,8 @@ class g2_import_task_Core { } $task->set("done", $done); - $root_g2_id = g2(GalleryCoreApi::getDefaultAlbumId()); - $root = ORM::factory("g2_map")->where("g2_id", "=", $root_g2_id)->find(); - if (!$root->loaded()) { - $root->g2_id = $root_g2_id; - $root->g3_id = 1; - $root->save(); - } + // Ensure G2 ACLs are compacted to speed up import. + g2(GalleryCoreApi::compactAccessLists()); } $modes = array("groups", "users", "albums", "items", "comments", "tags", "highlights", "done"); @@ -128,7 +123,9 @@ class g2_import_task_Core { case "albums": if (empty($queue)) { - $task->set("queue", $queue = g2(GalleryCoreApi::fetchAlbumTree())); + $g2_root_id = g2(GalleryCoreApi::getDefaultAlbumId()); + $tree = g2(GalleryCoreApi::fetchAlbumTree()); + $task->set("queue", $queue = array($g2_root_id => $tree)); } $log_message = g2_import::import_album($queue); if ($log_message) { |