From 953be781dc91254599224fa6e95fcc435e787975 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 24 Apr 2011 22:51:14 -0700 Subject: Refactor the meat of g2_import::import_album() off into a separate function so taht we can call it on the root album as well. Fixes --- modules/g2_import/helpers/g2_import_task.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules/g2_import/helpers/g2_import_task.php') diff --git a/modules/g2_import/helpers/g2_import_task.php b/modules/g2_import/helpers/g2_import_task.php index 5e908676..31615a55 100644 --- a/modules/g2_import/helpers/g2_import_task.php +++ b/modules/g2_import/helpers/g2_import_task.php @@ -127,6 +127,12 @@ class g2_import_task_Core { $g2_root_id = g2(GalleryCoreApi::getDefaultAlbumId()); $tree = g2(GalleryCoreApi::fetchAlbumTree()); $task->set("queue", $queue = array($g2_root_id => $tree)); + + // Update the root album to reflect the Gallery2 root album. + $root_album = item::root(); + g2_import::set_album_values( + $root_album, g2(GalleryCoreApi::loadEntitiesById($g2_root_id))); + $root_album->save(); } $log_message = g2_import::import_album($queue); if ($log_message) { -- cgit v1.2.3