diff options
author | Andy Staudacher <andy.st@gmail.com> | 2010-02-07 21:39:26 -0800 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2010-02-07 21:39:26 -0800 |
commit | bca3eeb92399093214ac0f5a74a380b14ffd0405 (patch) | |
tree | 606aaf54b9c0fdbc5b6c2fc9a9ac10cbabf66d33 /modules/g2_import/helpers/g2_import_task.php | |
parent | 9695041a86ffeb1bfc5ced654cb04a9833eb9288 (diff) |
Import G2 permissions in the import process. Ignores user and item specific permissions.
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) { |