diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-06-23 17:09:37 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-06-23 17:09:37 -0700 |
commit | 2a190660baeff8cd708926cea79f94f1630418b7 (patch) | |
tree | b763e7bae960d1edb83321aa8ebd6fbce158dfd4 /modules/g2_import/helpers | |
parent | b9b68e09527f2680252bcba054019c45db07829a (diff) |
Gracefully handle the case when the gallery2 instances moves somewhere
else (or gets deleted).
Fixes ticket #458
Diffstat (limited to 'modules/g2_import/helpers')
-rw-r--r-- | modules/g2_import/helpers/g2_import_task.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/g2_import/helpers/g2_import_task.php b/modules/g2_import/helpers/g2_import_task.php index 4cd95581..3961097d 100644 --- a/modules/g2_import/helpers/g2_import_task.php +++ b/modules/g2_import/helpers/g2_import_task.php @@ -21,15 +21,19 @@ class g2_import_task_Core { static function available_tasks() { if (g2_import::is_configured()) { g2_import::init(); + } + + + if (class_exists("GalleryCoreApi")) { return array(Task_Definition::factory() ->callback("g2_import_task::import") ->name(t("Import from Gallery 2")) ->description( t("Gallery %version detected", array("version" => g2_import::version()))) ->severity(log::SUCCESS)); - } else { - return array(); } + + return array(); } static function import($task) { |