Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.11 apache2handler
I'm receiving e-mail notifications for comments that are marked as spam.
Perhaps there should be a notification -- but it should point to the moderation queue, not the item itself (where of course, it doesn't appear).
Is this behaviour intentional?
Hi,
I have modified my g2 installation to get rid of the very same issue... I am attaching the diff so it can be helpful for others. Please note that I am using notifications only for comments, therefore there might be side effects that I am not aware of.
Hope this helps...
Well, I cannot find how to attach a file, so here is the diff:
Index: modules/notification/module.inc
--- modules/notification/module.inc (rテゥvision 20968)
+++ modules/notification/module.inc (copie de travail)
@@ -140,7 +140,9 @@
$handlerPath = 'modules/notification/classes/NotificationRouter.class';
$ret = GalleryCoreApi::registerFactoryImplementation('GalleryEventListener',
'NotificationRouter', 'NotificationRouter',
- $handlerPath, 'notification', empty($hints) ? null : $hints, 4);
+ $handlerPath, 'notification', empty($hints) ? null : $hints, 6);
+// UPDATE g2_FactoryMap SET `g_orderWeight`=6 WHERE `g_classType`='GalleryEventListener' AND `g_className` = 'NotificationRouter';
+// rm -rf .../g2data/cache/{module,entity}/* */
if ($ret) {
return $ret;
}
Index: modules/comment/classes/CommentAddNotification.class
===================================================================
--- modules/comment/classes/CommentAddNotification.class (rテゥvision 20968)
+++ modules/comment/classes/CommentAddNotification.class (copie de travail)
@@ -34,6 +34,10 @@
*/
function getDescription() {
global $gallery;
+ if (($this->_event != NULL) && ($this->_event->getEntity() != NULL)) {
+ if ($this->_event->getEntity()->getPublishStatus() == COMMENT_PUBLISH_STATUS_SPAM)
+ return $this->_translateText('comment', $gallery->i18n('New SPAM detected'));
+ }
return $this->_translateText('comment', $gallery->i18n('Comment Added'));
}
@@ -49,12 +53,21 @@
}
$title = GalleryUtilities::markup($item->getTitle(), 'strip');
+ if ($this->_event->getEntity()->getPublishStatus() == COMMENT_PUBLISH_STATUS_SPAM) {
return $this->_translateText('comment',
+ array('text' => $gallery->i18n('A suspected SPAM comment has been posted on %s. The full '
+ . 'comment is provided below. '. "\n\n" . '%s'
+ . "\n\nTo view the new comment at the site click here (will not work):\n" . '%s'),
+ 'arg1' => $title, 'arg2' => $this->getComment(),
+ 'arg3' => $this->getItemUrl()));
+ } else {
+ return $this->_translateText('comment',
array('text' => $gallery->i18n('A new comment has been posted on %s. The full '
. 'comment is provided below. '. "\n\n" . '%s'
. "\n\nTo view the new comment at the site click here:\n" . '%s'),
'arg1' => $title, 'arg2' => $this->getComment(),
'arg3' => $this->getItemUrl()));
+ }
}
/**