summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-15 19:59:46 -0700
committerBharat Mediratta <bharat@menalto.com>2009-06-15 19:59:46 -0700
commitb8c68ce2f9e61ff7df5c17cd99142eb75df17a0c (patch)
treea84d17efe73e3588dd34e899dc89604acf23a27d
parent79582ee5bfe9f457a31a13ac92ee00efd93fe417 (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
-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 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;