Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => PostgreSQL and SQLite Support => Topic started by: amandaf on November 11, 2010, 09:31:41 AM

Title: Problem when the moderation feature is turned on
Post by: amandaf on November 11, 2010, 09:31:41 AM
Please help!  My forum is working beautifully, except I run into problems when I turn on the moderation feature. 

When moderation is off, the site sends notification emails to users that have 'notify' on for topics.  However, once moderation is turned on, notification emails stop.  Any idea on why this might be happening?

We are ready to roll this out and this is the one show stopper.  Any advice would be much appreciated!
Title: Re: Problem when the moderation feature is turned on
Post by: xenovanis on November 11, 2010, 03:28:33 PM
Hello Amanada and welcome :)

Do notification for all stops or is it just for the unapproved posts and topics?

What version of SMF are you using?
Title: Re: Problem when the moderation feature is turned on
Post by: amandaf on November 12, 2010, 11:20:44 AM
Notifications work for the moderator and admin.  Anything that has to be approved by the moderator (for example, if a regular user clicks notify for a topic or board) even after being approved by the moderator doesn't result in a notification email.   If I turn the moderation feature off, all notification emails work perfectly.

We are using:
SMF version 2.0 RC3
Postgresql version 8.3
PHP version 5.2.5
Apache version 2.2.3
Title: Re: Problem when the moderation feature is turned on
Post by: xenovanis on November 17, 2010, 04:51:38 PM
Sorry for the late reply. :( I'll do some testing on this on RC3 and RC4, to see if I can replicate this. I'm quite busy this week, so it may have to wait a couple of days.
Title: Re: Problem when the moderation feature is turned on
Post by: Oldiesmann on December 11, 2010, 11:19:59 PM
Were either of you ever able to figure this out? If not, I'll poke around and see what I can do.
Title: Re: Problem when the moderation feature is turned on
Post by: amandaf on December 14, 2010, 12:35:28 PM
Nope. Nothing yet. We tried upgrading a test version to RC4 and that didn't help.  We would appreciate any help you can give!
Title: Re: Problem when the moderation feature is turned on
Post by: Oldiesmann on December 21, 2010, 12:55:16 PM
I will poke around a bit this afternoon and see what I can come up with.
Title: Re: Problem when the moderation feature is turned on
Post by: Oldiesmann on December 21, 2010, 11:00:03 PM
I can't figure out what's going on here either unfortunately, at least by looking at the code. This is the code that sends out notifications after approval (from the approvePosts() function in Subs-Post.php):

// Finally, least importantly, notifications!
if ($approve)
{
if (!empty($notification_topics))
{
require_once($sourcedir . '/Post.php');
notifyMembersBoard($notification_topics);
}
if (!empty($notification_posts))
sendApprovalNotifications($notification_posts);

$smcFunc['db_query']('', '
DELETE FROM {db_prefix}approval_queue
WHERE id_msg IN ({array_int:message_list})
AND id_attach = {int:id_attach}',
array(
'message_list' => $msgs,
'id_attach' => 0,
)
);
}


None of the code that determines whether or not notifications get sent out is database-dependent - $approve is set when the function is called (defaulting to true), and $notification_topics and $notification_posts are set in the function itself.

I will have to play with this more in the coming weeks when I have more time and see if I can get to the bottom of it.