notification of removed topics

Started by RFD, February 04, 2020, 10:07:43 AM

Previous topic - Next topic

RFD

when a topic is removed, all users who are watching that thread, who that expect email notification, are email notified of the thread's removal.  in many instances this is not a good thing, particularly for selective threads that are many many years old.

is it possible to stop user email notification of selectively removed threads?

Kindred

I don't think that is standard behavior
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Illori

I believe only the topic starter is notified of moderation actions on the topic not all users watching the topic.

RFD

Quote from: Illori on February 04, 2020, 03:07:15 PM
I believe only the topic starter is notified of moderation actions on the topic not all users watching the topic.

i did testing on a live system (smf 2.0.15) and everyone gets an email if the thread is removed.  this can, and has, caused a number of issues with users, particularly if the thread is many years old.

Sir Osis of Liver

You could try setting up an archive board that's visible only to admins, move the topic there instead of deleting it.  Don't think that would trigger a notification email (haven't tried it).  Would also give you the option of restoring the topic if you ever wanted to.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kindred

Seriously... I have never seen this behavior
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

RFD

Quote from: Kindred on February 04, 2020, 04:05:10 PM
Seriously... I have never seen this behavior

trust me, it's happening big time ... and we're constantly getting emails from users subscribed to those threads.

RFD

Quote from: Sir Osis of Liver on February 04, 2020, 04:04:49 PM
You could try setting up an archive board that's visible only to admins, move the topic there instead of deleting it.  Don't think that would trigger a notification email (haven't tried it).  Would also give you the option of restoring the topic if you ever wanted to.

worth a try, i'll test it out now ....

Shambles

Quote from: RFD
i did testing on a live system (smf 2.0.15) and everyone gets an email if the thread is removed.

Does that installation employ a recycle board for deleted topics?  If not, try setting one up.

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RFD


RFD

Quote from: Sir Osis of Liver on February 04, 2020, 04:04:49 PM
You could try setting up an archive board that's visible only to admins, move the topic there instead of deleting it.  Don't think that would trigger a notification email (haven't tried it).  Would also give you the option of restoring the topic if you ever wanted to.

nope, i created an Admin board on the LA forum and moved over a thread that had a post by a non-admin test user (me) without a board redirect notice, and i got an email (as the test user) that the thread was moved.

Illori

did your test user create the topic? if so that is why they got the email.

RFD

Quote from: Illori on February 04, 2020, 04:22:25 PM
did your test user create the topic? if so that is why they got the email.

no - i made sure of that, the test user was a poster on someone else's thread.  i created a test user login, so as admin i had control of the entire test ...

there was a old thread about 6 posts deep that the test user (me) added the 7th post.  i (admin) made the 8th post.  the test user (me) got an email that the thread was updated (due to the admin post).  then i had the test user make a 9th post and the admin created a dump board with admin permission only, moved the thread to the dump board (with no board redirect) and the test user got an email about the board move.

Sir Osis of Liver

Are you seeing this behavior on more than one forum?  Only problematic mod I see at TG is Tapatalk, but don't recall it's ever caused something like this.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RFD

Quote from: Sir Osis of Liver on February 04, 2020, 04:58:22 PM
Are you seeing this behavior on more than one forum?  Only problematic mod I see at TG is Tapatalk, but don't recall it's ever caused something like this.

been happening on the TG forum for perhaps a year or so, and i just did my testing on the LA forum.  i'll test it out on the BP forum ...

Illori

'notification_remove' => array(
/*
@additional_params: notification_remove
@description:
*/
'subject' => 'Topic removed: {TOPICSUBJECT}',
'body' => 'A topic you are watching has been removed by {POSTERNAME}.

{REGARDS}',


Sources/RemoveTopic.php

// Notify people that this topic has been removed.
sendNotifications($topic, 'remove');


that is on line 73/74

just comment out the sendNotifications line with // in front of it and no one will get that email.

Sir Osis of Liver

Tapatalk isn't installed on BP, but 'List Of Users In Forum/Board/Topic' mod is on both.

Would be interesting to know what's causing this, no one's reported it previously afaik.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RFD

Quote from: Illori on February 04, 2020, 05:05:38 PM
'notification_remove' => array(
/*
@additional_params: notification_remove
@description:
*/
'subject' => 'Topic removed: {TOPICSUBJECT}',
'body' => 'A topic you are watching has been removed by {POSTERNAME}.

{REGARDS}',


Sources/RemoveTopic.php

// Notify people that this topic has been removed.
sendNotifications($topic, 'remove');


that is on line 73/74

just comment out the sendNotifications line with // in front of it and no one will get that email.

excellent!  thank you very much!

Shambles

@Illori Didn't you already make this statement...?

Quote from: Illori
I believe only the topic starter is notified of moderation actions on the topic not all users watching the topic.

I believe this would resolve the issue:

Quote from: Shambles on February 04, 2020, 04:12:50 PM
Does that installation employ a recycle board for deleted topics?  If not, try setting one up.

Illori

according to the code, it says all watching the topic get the notice. at the time of the comment i did not have the code to look at.

RFD

Quote from: Shambles on February 04, 2020, 05:11:50 PM
@Illori Didn't you already make this statement...?

Quote from: Illori
I believe only the topic starter is notified of moderation actions on the topic not all users watching the topic.

I believe this would resolve the issue:

Quote from: Shambles on February 04, 2020, 04:12:50 PM
Does that installation employ a recycle board for deleted topics?  If not, try setting one up.

and in my testing, that failed and i posted about that on this thread.

RFD

Quote from: Sir Osis of Liver on February 04, 2020, 05:07:00 PM
Tapatalk isn't installed on BP, but 'List Of Users In Forum/Board/Topic' mod is on both.

Would be interesting to know what's causing this, no one's reported it previously afaik.

tapatalk needs removal since ant's theme is better, but there was that mod removal error that i need to fix with a forum clean.

the 'list of users ..." hack is important to have on all 3 forums.

Shambles

Quote from: Shambles
Does that installation employ a recycle board for deleted topics?  If not, try setting one up.

Quote from: RFD on February 04, 2020, 05:16:06 PM
and in my testing, that failed and i posted about that on this thread.

I can't see where you mentioned you'd tried using the "recycle board" feature.

Sir Osis of Liver

I'm seeing clean uninstall for Tapatalk at TG.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RFD

Quote from: Shambles on February 04, 2020, 05:29:40 PM
Quote from: Shambles
Does that installation employ a recycle board for deleted topics?  If not, try setting one up.

Quote from: RFD on February 04, 2020, 05:16:06 PM
and in my testing, that failed and i posted about that on this thread.

I can't see where you mentioned you'd tried using the "recycle board" feature.

post #11 on this thread (admin board)

RFD

Quote from: Sir Osis of Liver on February 04, 2020, 05:31:10 PM
I'm seeing clean uninstall for Tapatalk at TG.

then it was the tapatalk at BP.

Shambles

Quote from: RFD on February 04, 2020, 05:35:15 PM
Quote from: Shambles on February 04, 2020, 05:29:40 PM
Quote from: Shambles
Does that installation employ a recycle board for deleted topics?  If not, try setting one up.

Quote from: RFD on February 04, 2020, 05:16:06 PM
and in my testing, that failed and i posted about that on this thread.

I can't see where you mentioned you'd tried using the "recycle board" feature.

post #11 on this thread (admin board)

Moving is different to deleting. Deleting a thread within a forum that has a "recycle bin feature" invokes different code to that which deals with moving threads. 

Anyway, you seem set in your opinions...

RFD

Quote from: Shambles on February 04, 2020, 05:45:47 PM
Quote from: RFD on February 04, 2020, 05:35:15 PM
Quote from: Shambles on February 04, 2020, 05:29:40 PM
Quote from: Shambles
Does that installation employ a recycle board for deleted topics?  If not, try setting one up.

Quote from: RFD on February 04, 2020, 05:16:06 PM
and in my testing, that failed and i posted about that on this thread.

I can't see where you mentioned you'd tried using the "recycle board" feature.

post #11 on this thread (admin board)

Moving is different to deleting. Deleting a thread within a forum that has a "recycle bin feature" invokes different code to that which deals with moving threads. 

Anyway, you seem set in your opinions...

well, not opinions, observations ....

Sir Osis of Liver

Quote from: RFD on February 04, 2020, 05:35:54 PM
Quote from: Sir Osis of Liver on February 04, 2020, 05:31:10 PM
I'm seeing clean uninstall for Tapatalk at TG.

then it was the tapatalk at BP.

It's not installed at BP.  You should uninstall it at TG, it's caused a lot of problems.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RFD

Quote from: Sir Osis of Liver on February 04, 2020, 06:11:45 PM
Quote from: RFD on February 04, 2020, 05:35:54 PM
Quote from: Sir Osis of Liver on February 04, 2020, 05:31:10 PM
I'm seeing clean uninstall for Tapatalk at TG.

then it was the tapatalk at BP.

It's not installed at BP.  You should uninstall it at TG, it's caused a lot of problems.

uninstalled fine this time ... and deleted.  amen.

RFD

Quote from: Illori on February 04, 2020, 05:05:38 PM
'notification_remove' => array(
/*
@additional_params: notification_remove
@description:
*/
'subject' => 'Topic removed: {TOPICSUBJECT}',
'body' => 'A topic you are watching has been removed by {POSTERNAME}.

{REGARDS}',


Sources/RemoveTopic.php

// Notify people that this topic has been removed.
sendNotifications($topic, 'remove');


that is on line 73/74

just comment out the sendNotifications line with // in front of it and no one will get that email.

failed ...

i made the changes as defined above, verified the changed file exists on the server, then posted on a thread as a test user, posted again on the thread as admin, the test user gets an email that a post was made on a watched thread, admin removes the entire thread, the test user gets an email notification that the thread was removed.

Illori

do you see that same line you commented elsewhere in the file? if so comment it out as you did before with the //. I don't have the code in front of me to check.

RFD

Quote from: Illori on February 05, 2020, 10:11:16 AM
do you see that same line you commented elsewhere in the file? if so comment it out as you did before with the //. I don't have the code in front of me to check.

nope, line 74 of the file in question is the only instance for ...

// Notify people that this topic has been removed.
sendNotifications($topic, 'remove');


... that was changed to ...

// Notify people that this topic has been removed.
// sendNotifications($topic, 'remove');

Illori

what is the email that the user received?

RFD

Quote from: Illori on February 05, 2020, 03:35:19 PM
what is the email that the user received?

email received by the tester user ...

"A topic you are watching has been removed by Admin

Regards,
The TG Team."

Illori

seems that is also called in Sources/MessageIndex.php

// Only log the topic ID if it's not in the recycle board.
logAction('remove', array((empty($modSettings['recycle_enable']) || $modSettings['recycle_board'] != $removeCacheBoards[$topic] ? 'topic' : 'old_topic_id') => $topic, 'board' => $removeCacheBoards[$topic]));
sendNotifications($topic, 'remove');
}


comment out with // that sendNotifications line.

RFD

Quote from: Illori on February 05, 2020, 05:03:45 PM
seems that is also called in Sources/MessageIndex.php

// Only log the topic ID if it's not in the recycle board.
logAction('remove', array((empty($modSettings['recycle_enable']) || $modSettings['recycle_board'] != $removeCacheBoards[$topic] ? 'topic' : 'old_topic_id') => $topic, 'board' => $removeCacheBoards[$topic]));
sendNotifications($topic, 'remove');
}


comment out with // that sendNotifications line.

darn it, the test failed again, the topic remove notifier must be triggered from somewhere else.

Illori

i dont know why this is failing for you. all i can suggest is commenting out the template so it will not be able to send the email.

'notification_remove' => array(
/*
@additional_params: notification_remove
@description:
*/
'subject' => 'Topic removed: {TOPICSUBJECT}',
'body' => 'A topic you are watching has been removed by {POSTERNAME}.

{REGARDS}',
),


Themes/default/languages/emailTemplates.english.php

surround that with /* and */ hopefully that will do the trick.


RFD

Quote from: Illori on February 05, 2020, 05:34:44 PM
i dont know why this is failing for you. all i can suggest is commenting out the template so it will not be able to send the email.

'notification_remove' => array(
/*
@additional_params: notification_remove
@description:
*/
'subject' => 'Topic removed: {TOPICSUBJECT}',
'body' => 'A topic you are watching has been removed by {POSTERNAME}.

{REGARDS}',
),


Themes/default/languages/emailTemplates.english.php

surround that with /* and */ hopefully that will do the trick.

made and verified those changes on the server, the test user still gets email notification of a removed topic.

the tester user's notification of a post by admin ...

A reply has been posted to a topic you are watching by Admin.

View the reply at: http://www.tgxxxxxxxx.com/tgsmf/index.php?topic=171084.new;topicseen#new

Unsubscribe to this topic by using this link: http://www.tgxxxxxxxx.com/tgsmf/index.php?action=notify;topic=171084.0

The text of the reply is shown below:
admin test #12

Regards,
The TG Team.


admin then removes the topic and the test user gets notification email ...

A topic you are watching has been removed by Admin.

Regards,
The TG Team.

RFD

anyone else with an insight or suggestion for fixing this problem?

make no mistake, this IS a forum problem.  pruning any or many selective threads that are many years old will generate a massive amount of notification emails to users who are baffled as to why, many years later, they're notified of a thread removal.  this can also stir up some user controversy as to why their "most important" threads/posts are being removed from the forum.  in the best of all worlds, an admin control panel switch to turn off/on topic removals would be most appropriate.   

Illori

are you using a language other then "English"?

if you are using for example British English or English-utf-8 then you need to modify those language files as well.

RFD

Quote from: Illori on February 07, 2020, 07:20:18 AM
are you using a language other then "English"?

if you are using for example British English or English-utf-8 then you need to modify those language files as well.

english only.

English    ISO-8859-1    40598    en_US

RFD

i've been tediously using FAR (a find and replace sh app) to search through source and theme files to try to hunt down what's triggering that "remove topic" notifier, but so far no luck.  this is getting exasperating.

Sir Osis of Liver

Have you tried setting up a test install with clean files, connect to your production database, see if problem persists?  Will be on a while tonight, pm me if you don't get it.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Illori

if you set all groups temporarily to not be able to see that board, then you can delete/modify/change any/all topics without any notifications being sent out as only those can view the topic get notifications.

when done set the board back to visible.

RFD

Quote from: Illori on February 07, 2020, 12:33:09 PM
if you set all groups temporarily to not be able to see that board, then you can delete/modify/change any/all topics without any notifications being sent out as only those can view the topic get notifications.

when done set the board back to visible.

turning off a board just isn't feasible for the most part.

shawnb61

Do you have a test copy of your forum? 

I believe the field in question is notify_types on the members table.  The default is actually hard-coded on the db itself on the members table to '2'.  '1' is replies & moderation, '2' is replies & moderation for your topics, '3' is replies only & '4' is nothing.  These 4 values correspond to the values in the dropdown available to the users under Profile | Modify Profile | Notifications. 

I have not done this myself, as we don't do a lot of such maintenance.  You are on your own here.  If I absolutely had to, I would change the DB default to 3.  After testing & confirming the desired behavior, I would consider changing all '2's to '3's on the members table.  This, of course, assumes nobody really wants a '2' & nobody has deliberately set it to a '2'. 

So proceed with caution, do a couple backups, & test... test... test...   
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

RFD

Quote from: shawnb61 on February 07, 2020, 03:16:08 PM
Do you have a test copy of your forum? 

I believe the field in question is notify_types on the members table.  The default is actually hard-coded on the db itself on the members table to '2'.  '1' is replies & moderation, '2' is replies & moderation for your topics, '3' is replies only & '4' is nothing.  These 4 values correspond to the values in the dropdown available to the users under Profile | Modify Profile | Notifications. 

I have not done this myself, as we don't do a lot of such maintenance.  You are on your own here.  If I absolutely had to, I would change the DB default to 3.  After testing & confirming the desired behavior, I would consider changing all '2's to '3's on the members table.  This, of course, assumes nobody really wants a '2' & nobody has deliberately set it to a '2'. 

So proceed with caution, do a couple backups, & test... test... test...

i appreciate your input and comment.  however, this would be an untried, untested, extrinsic work-around for something that should be intrinsically available and vetted for all versions of SMF.  i have no smarts to attempt what you propose.  but more importantly, it is not the kind of global change i'd want to make for all my users.

what's needed at the very least is a quick and temporary way to turn off post notifications, remove the thread, turn back post notifications.  not a pretty way to do the job, but it sure would beat removing hundreds of ancient threads where all those thread posters will get email notifications.   

it appears none of the SMF dev gurus can fix what's clearly broke.  no one can add a switch that dumb admins like me can tick off to fix this glaring SMF problem without having to resort to becoming an SMF dev?

 

Advertisement: