• Welcome to Simple Machines Community Forum. Please login or sign up.
December 01, 2021, 05:37:36 AM

News:

SMF 2.0.18 has been released! Please update. Read more.


[2.0] No notifications sent on approving regular user's reply.

Started by harlow_1, November 12, 2019, 09:33:27 PM

Previous topic - Next topic

harlow_1

No mods.
Default installation.
Moderation enabled and required on regular user replies.

File Subs-Post.php version 2.0.14    (in a 2.0.15 install)

Line 2854
is
   $topics[] = $msg['id'];
should be
   $topics[] = $topic;

Line 2914
is
   'TOPICSUBJECT' => $topicData[$row['id_topic']]['subject'],
should be
   'TOPICSUBJECT' => $msg['subject'];

Line 2959
is
   'POSTERNAME' = un_htmlspecialchars($topicData[$row['id_topic']['name']),
should be
   'POSTERNAME' = un_htmlspecialchars($msg['name']),

Line 2934
is
   sendmail($row['email_address'], $emaildata['subject'], $emaildata['body'], null, 'm' . $topicData[$row['id_topic']]['last_id']);
should be
   sendmail($row['email_address'], $emaildata['subject'], $emaildata['body'], null, 'm' . $msg['id']);

Kindred

Why do you say that??

No one else has complained of any issues.
Also,  2.0.14 is an old version. Bugs should only be reported in the recent version.... because even if those were bugs, they may have been fixed in the next version
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

harlow_1

Quote from: Kindred on November 12, 2019, 10:53:25 PM
Why do you say that??

No one else has complained of any issues.
Also,  2.0.14 is an old version. Bugs should only be reported in the recent version.... because even if those were bugs, they may have been fixed in the next version

Get the 2.0.15 version:  https://download.simplemachines.org/index.php?thanks;filename=smf_2-0-15_install.tar.bz2
bunzip2 it.  tar xvf it.
Look at Subs-Post.php.
See if it doesn't say 2.0.14.
Look at the first line I mentioned.
Is it not as I said?
Is it not a bug?

Illori

i dont see that we have any template in EmailTemplates.english.php that is involved in letting a user know a post was approved... i dont think a user should get one anyway.

what email is a user getting when your changes are put in effect?

harlow_1

Quote from: Illori on November 13, 2019, 04:47:53 AM
i dont see that we have any template in EmailTemplates.english.php that is involved in letting a user know a post was approved... i dont think a user should get one anyway.

what email is a user getting when your changes are put in effect?

The missing notification is of the new message after moderation, not of the moderation approval itself.

The template is the same as for a non-moderated new message notification.

Moderated new message notification is sent in a different function from non-moderated new message notification.

It's in the code.
https://download.simplemachines.org/index.php?thanks;filename=smf_2-0-15_install.tar.bz2
File Subs-Post.php
Function sendApprovalNotifications()


Illori

you mean if a topic was approved those that are watching the board for new topics does not get an email that the topic now exists?

the same issue happens if a topic is moved from one board to another, those watching the board does not get notified. at this time in SMF 2.0 I don't think we can fix this.

harlow_1

Quote from: Illori on November 13, 2019, 09:41:49 AM
you mean if a topic was approved those that are watching the board for new topics does not get an email that the topic now exists?

the same issue happens if a topic is moved from one board to another, those watching the board does not get notified. at this time in SMF 2.0 I don't think we can fix this.

I'm talking about new replies in an existing topic.

There is a bug in sending notifications of a new reply after moderation.  I found it in operation.  I found it in the code.  I found a fix.  I tested the fix.  It works.  I posted the fix above.

Have you looked at the code?
With some examination don't you see that that
   $topics[] = $msg['id'];
is wrong?
sendApprovalNotifications() gets passed an array of messages, i.e. $notification_posts.  It then makes an array named $topics but puts message id's in it.  Later in a db_query it compares those message ids with topic ids in log_notify.  They aren't going to match.  It gives no matches and no notifications are sent.

If moderation is off and a user has set notify on a topic then that user should receive notification when another user posts a new reply post/message, right?

If moderation is on and a user has set notify on a topic then that user should receive notification when a moderator approves a reply submitted by another user, right?

It didn't do that before my fix.  It does do that after my fix.

The fix does not affect the notification of new or moved topics.  That is done in a different function.


Illori

Quote from: harlow_1 on November 13, 2019, 10:52:46 AM

Have you looked at the code?
With some examination don't you see that that
   $topics[] = $msg['id'];
is wrong?


I am not a developer, I am not a coder, I did not look at the code as I don't understand it all. even with a fix it is not a guarantee that it will get in any future patch for SMF 2.0.

harlow_1

Quote from: Illori on November 13, 2019, 10:59:03 AM
Quote from: harlow_1 on November 13, 2019, 10:52:46 AM

Have you looked at the code?
With some examination don't you see that that
   $topics[] = $msg['id'];
is wrong?


I am not a developer, I am not a coder, I did not look at the code as I don't understand it all. even with a fix it is not a guarantee that it will get in any future patch for SMF 2.0.

OK.  :)

What does a project manager do?

I wasn't thinking about patches but maybe I should.
I have the fix for my forum.
I was just sharing with any developers or administrators that might be interested.

Kindred

If there is an actual bug, then we appreciate you sharing your fix.

My biggest issue is that you posted a series of code changes with no actual explanation as to why the changes were needed or what issue the changes were intended to fix (the title of this thread is not sufficient, IMO)

FYI: The project manager manages the project. :D  (I'm being silly, and serious at the same time. That's really the correct explanation for the role)
https://www.pmi.org/about/learn-about-pmi/who-are-project-managers
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

harlow_1

Quote from: Kindred on November 13, 2019, 12:17:38 PM
If there is an actual bug, then we appreciate you sharing your fix.


Would I be correct in guessing that you are also not a code/developer kind of guy?

Wouldn't there be such types on this board?  I would expect that someone familiar with the code and its operation would be able to look at what I have described and confirm it in a matter of minutes.  shawnb61 maybe?

Arantor

This is not something that can be verified "in a matter of minutes" but you can probably dismiss me as "not a coder kind of guy" too.
No good deed goes unpunished
All helpful urges should be circumvented

harlow_1

Quote from: harlow_1 on November 13, 2019, 11:08:47 PM
Quote from: Kindred on November 13, 2019, 12:17:38 PM
If there is an actual bug, then we appreciate you sharing your fix.


Would I be correct in guessing that you are also not a code/developer kind of guy?

Wouldn't there be such types on this board?  I would expect that someone familiar with the code and its operation would be able to look at what I have described and confirm it in a matter of minutes.  shawnb61 maybe?

Kindred, I wasn't being dismissive.  I asked in a polite way.  From your statement you aren't yet ready to recognize this as an actual bug.  But an independent opinion from a developer type that you respect would help to persuade you, wouldn't it?

Illori

as I said above, even if this is accepted as a valid bug, there is a pretty good chance this will not be fixed in SMF 2.0.

harlow_1

Quote from: Illori on November 14, 2019, 11:23:01 AM
as I said above, even if this is accepted as a valid bug, there is a pretty good chance this will not be fixed in SMF 2.0.

I don't think that makes a difference to me.  I have the fix and I'm putting it in the forum I'm operating.

But I'm curious as to your reasons for saying that.  Are there no more fixes at all being applied to 2.0?  Is it because you and the developers are focusing on 2.1?  Is 2.1 is imminent?  Am I going to be urged to upgrade to 2.1?

shawnb61

I have confirmed this & logged #88 internally.

Note this is VERY specific to the regular notification... but... after moderation approval.  Part of the problem above is at times it sounded like it was broader.  A more comprehensive description in the first post would have been helpful. 

Issue also confirmed in 2.0.16. 
That logic was completely rewritten in 2.1; I'm still looking at 2.1. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Arantor

Please don't fix this in 2.0.16, defer it to 2.0.17 if it is going to be fixed - 16 is already very late now.
No good deed goes unpunished
All helpful urges should be circumvented

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

harlow_1

Quote from: shawnb61 on December 01, 2019, 01:42:15 PM
I have confirmed this & logged #88 internally.

Note this is VERY specific to the regular notification... but... after moderation approval.  Part of the problem above is at times it sounded like it was broader.  A more comprehensive description in the first post would have been helpful. 

Issue also confirmed in 2.0.16. 
That logic was completely rewritten in 2.1; I'm still looking at 2.1.

Thanks.

Personally I'm satisfied with my 2.0.15.  I'm wondering if I will be urged or required to upgrade to 2.1 in the foreseeable future.

Arantor

Well, at some point 2.0 will cease to be supported, but that's not going to be until whatever comes after 2.1 is ready.

And at some point, it's going to become more and more difficult to retrofit PHP compatibility changes; the changes in 7.2+ cannot be fixed across the board in core and all mods, right now they can be mitigated but the underlying problem cannot be fixed and at some point they will stop working and at that point it'll be about helping people move forward.

We still see people on 1.1; that came out in 2006, and it has been unsupported (outside of upgrades) for a while, but we're helping people upgrade to a version that isn't 13 years old, that does have security patches etc.
No good deed goes unpunished
All helpful urges should be circumvented

Advertisement: