summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-16 10:59:46 +0800
committer <unostar@danalan.info>2009-06-16 18:27:36 +0800
commit0b05383c4565807b8aae8e5c5310a193d01b5a96 (patch)
treea18e9f41119636edc0141093ca369f31d4c3eeb4
parent4797f5b0cf52434d5c1e3b440cbabb10a05a4ef9 (diff)
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: <unostar@danalan.info>
-rw-r--r--modules/g2_import/helpers/g2_import.php3
1 files changed, 1 insertions, 2 deletions
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;