From 0b05383c4565807b8aae8e5c5310a193d01b5a96 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 16 Jun 2009 10:59:46 +0800 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 Signed-off-by: --- 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 30ddda50..0491722d 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -172,8 +172,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()); @@ -182,6 +180,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