From b8c68ce2f9e61ff7df5c17cd99142eb75df17a0c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 15 Jun 2009 19:59:46 -0700 Subject: Don't try to require GalleryCommentHelper.class if the module is not active, since the code may not even be present. This assumes that if the G2 comment module *is* active that the code is present, but that's part of the assumption that the G2 we're importing from is healthy. Fixes ticket #409 --- modules/g2_import/helpers/g2_import.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'modules/g2_import/helpers') diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index f385907d..bcaffab1 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -178,8 +178,6 @@ class g2_import_Core { */ static function stats() { global $gallery; - GalleryCoreApi::requireOnce("modules/comment/classes/GalleryCommentHelper.class"); - $root_album_id = g2(GalleryCoreApi::getDefaultAlbumId()); $stats["users"] = g2(GalleryCoreApi::fetchUserCount()); $stats["groups"] = g2(GalleryCoreApi::fetchGroupCount()); @@ -188,6 +186,7 @@ class g2_import_Core { $stats["movies"] = g2(GalleryCoreApi::fetchItemIdCount("GalleryMovieItem")); if (g2_import::g2_module_active("comment") && module::is_active("comment")) { + GalleryCoreApi::requireOnce("modules/comment/classes/GalleryCommentHelper.class"); list (, $stats["comments"]) = g2(GalleryCommentHelper::fetchAllComments($root_album_id, 1)); } else { $stats["comments"] = 0; -- cgit v1.2.3