From 17c58c8dceb9dcc96acaaefacf2c6e0c00c06a31 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 17 May 2009 00:46:53 +0000 Subject: Skip over empty import modes. Fixes ticket #227 --- modules/g2_import/helpers/g2_import_task.php | 7 +++++++ 1 file changed, 7 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 c71997b4..161f0709 100644 --- a/modules/g2_import/helpers/g2_import_task.php +++ b/modules/g2_import/helpers/g2_import_task.php @@ -75,6 +75,13 @@ class g2_import_task_Core { $mode++; $task->set("last_id", 0); $queue = array(); + + // Start the loop from the beginning again. This way if we get to a mode that requires no + // actions (eg, if the G2 comments module isn't installed) we won't try to do any comments + // queries.. in the next iteration we'll just skip over that mode. + if ($modes[$mode] != "done") { + continue; + } } switch($modes[$mode]) { -- cgit v1.2.3