'Email on each new post' problem - Prime Notify
'Email on each new post' problem
We have had Prime Notify since 2013.
The 1.0.5 extension worked perfectly for 2 years. Then a month ago we began to have a posting-hang on replies, where you would post a reply and it took up to 5 minutes to submit.
I traced it to the Prime Notify extension. If it is disabled, replies submit normally. Enabled, they hang.
I further isolated it to one setting. If 'Email me on each new post' is set on User's choice, it hangs. If it is set on Yes or No, it submits normally.
Currently we are still using Prime Notify with 'Email me on each new post' set on Yes, so it will work without hanging. I would prefer to be able to have User's choice again.
No changes have been made to the extension or the board. This was out of the blue.
IT checked the logs and they don't see any error. They say they make changes to the server all the time, but if they were going to change anything big that would break an extension, they would let me know ahead of time.
I tried uninstalling (made sure it was gone from the database) and reinstalling, but that didn't help.
I can provide more detail (the long version) if you need it.
Thanks!
The 1.0.5 extension worked perfectly for 2 years. Then a month ago we began to have a posting-hang on replies, where you would post a reply and it took up to 5 minutes to submit.
I traced it to the Prime Notify extension. If it is disabled, replies submit normally. Enabled, they hang.
I further isolated it to one setting. If 'Email me on each new post' is set on User's choice, it hangs. If it is set on Yes or No, it submits normally.
Currently we are still using Prime Notify with 'Email me on each new post' set on Yes, so it will work without hanging. I would prefer to be able to have User's choice again.
No changes have been made to the extension or the board. This was out of the blue.
IT checked the logs and they don't see any error. They say they make changes to the server all the time, but if they were going to change anything big that would break an extension, they would let me know ahead of time.
I tried uninstalling (made sure it was gone from the database) and reinstalling, but that didn't help.
I can provide more detail (the long version) if you need it.
Thanks!
-
- Registered User
- Posts: 667
- Joined: Sat Dec 02, 2006 4:26 pm
Re: 'Email on each new post' problem
It's strange that it would stop working out of the blue. If it was going to stop working, I'd think it would have been after a phpBB update. It's been a long time since I worked on this code. I looked over all the sections mentioning USER_CHOICE but don't see anything obvious that would cause an issue.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
-
- Former Team Member
- Posts: 2992
- Joined: Fri May 06, 2005 5:58 pm
- Location: Redding, CA
Re: 'Email on each new post' problem
It could possibly be these lines in primehalo/primenotify/core/prime_notify.php:
#257: FROM ' . FORUMS_WATCH_TABLE . ' w, ' . USERS_TABLE . ' u
#265: FROM ' . TOPICS_WATCH_TABLE . ' w, ' . USERS_TABLE . ' u
Apparently this syntax is deprecated. The newer syntax is:
#257: FROM ' . FORUMS_WATCH_TABLE . ' w INNER JOIN ' . USERS_TABLE . ' u ON u.user_id = w.user_id
#265: FROM ' . TOPICS_WATCH_TABLE . ' w INNER JOIN ' . USERS_TABLE . ' u ON u.user_id = w.user_id
I really don't know if this is the cause or would make any difference at all.
#257: FROM ' . FORUMS_WATCH_TABLE . ' w, ' . USERS_TABLE . ' u
#265: FROM ' . TOPICS_WATCH_TABLE . ' w, ' . USERS_TABLE . ' u
Apparently this syntax is deprecated. The newer syntax is:
#257: FROM ' . FORUMS_WATCH_TABLE . ' w INNER JOIN ' . USERS_TABLE . ' u ON u.user_id = w.user_id
#265: FROM ' . TOPICS_WATCH_TABLE . ' w INNER JOIN ' . USERS_TABLE . ' u ON u.user_id = w.user_id
I really don't know if this is the cause or would make any difference at all.
Last edited by primehalo on Sun Apr 16, 2023 12:13 am
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
-
- Former Team Member
- Posts: 2992
- Joined: Fri May 06, 2005 5:58 pm
- Location: Redding, CA
Re: 'Email on each new post' problem
Hi! Thanks for your reply.
Tried it on the test board. Got an error.
Here is the file edit.
Here is the error when I tried to reply with the setting ticked on User's Choice.
[EDIT: REMOVED TABLE PREFIX, USER_ID]
Tried it on the test board. Got an error.
Here is the file edit.
Code: Select all
$sql = 'SELECT w.user_id as user_id
FROM ' . FORUMS_WATCH_TABLE . ' w, INNER JOIN ' . USERS_TABLE . ' u on u.user_id = w.user_id
WHERE w.forum_id = ' . (int) $post['forum_id'] . '
AND (w.notify_status = ' . NOTIFY_YES . ' OR (u.user_id = w.user_id AND u.user_primenotify_always_send = ' . self::ENABLED . '))
AND w.user_id <> ' . (int) $post['poster_id'];
}
else
{
$sql = 'SELECT w.user_id as user_id
FROM ' . TOPICS_WATCH_TABLE . ' w, INNER JOIN ' . USERS_TABLE . ' u u.user_id = w.user_id
WHERE w.topic_id = ' . (int) $post['topic_id'] . '
Code: Select all
General Error
SQL ERROR [ mysqli ]
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INNER JOIN ####_users u on u.user_id = w.user_id WHERE w.forum_id = 1 ...' at line 2 [1064]
SQL
SELECT w.user_id as user_id FROM ####_forums_watch w, INNER JOIN ####_users u on u.user_id = w.user_id WHERE w.forum_id = 1 AND (w.notify_status = 0 OR (u.user_id = w.user_id AND u.user_primenotify_always_send = 1)) AND w.user_id <> ####
BACKTRACE
FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()
FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 1023
CALL: trigger_error()
FILE: [ROOT]/phpbb/db/driver/mysqli.php
LINE: 195
CALL: phpbb\db\driver\driver->sql_error()
FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 345
CALL: phpbb\db\driver\mysqli->sql_query()
FILE: [ROOT]/ext/primehalo/primenotify/notification/type/topic.php
LINE: 61
CALL: phpbb\db\driver\factory->sql_query()
FILE: [ROOT]/phpbb/notification/manager.php
LINE: 273
CALL: primehalo\primenotify\notification\type\topic->find_users_for_notification()
FILE: [ROOT]/phpbb/notification/manager.php
LINE: 266
CALL: phpbb\notification\manager->add_notifications()
FILE: [ROOT]/includes/functions_posting.php
LINE: 2392
CALL: phpbb\notification\manager->add_notifications()
FILE: [ROOT]/posting.php
LINE: 1504
CALL: submit_post()
-
- Registered User
- Posts: 667
- Joined: Sat Dec 02, 2006 4:26 pm
Re: 'Email on each new post' problem
Sorry, I accidentally left the comma in there. I edited the post to remove it.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
-
- Former Team Member
- Posts: 2992
- Joined: Fri May 06, 2005 5:58 pm
- Location: Redding, CA
Re: 'Email on each new post' problem
Thanks!
Got an error again, with the corrected file on the server and the cache purged, setting ticked to User's Choice.
Corrected file
Error
Got an error again, with the corrected file on the server and the cache purged, setting ticked to User's Choice.
Corrected file
Code: Select all
$sql = 'SELECT w.user_id as user_id
FROM ' . FORUMS_WATCH_TABLE . ' w INNER JOIN ' . USERS_TABLE . ' u on u.user_id = w.user_id
WHERE w.forum_id = ' . (int) $post['forum_id'] . '
AND (w.notify_status = ' . NOTIFY_YES . ' OR (u.user_id = w.user_id AND u.user_primenotify_always_send = ' . self::ENABLED . '))
AND w.user_id <> ' . (int) $post['poster_id'];
}
else
{
$sql = 'SELECT w.user_id as user_id
FROM ' . TOPICS_WATCH_TABLE . ' w INNER JOIN ' . USERS_TABLE . ' u u.user_id = w.user_id
WHERE w.topic_id = ' . (int) $post['topic_id'] . '
AND (w.notify_status = ' . NOTIFY_YES . ' OR (u.user_id = w.user_id AND u.user_primenotify_always_send = ' . self::ENABLED . '))
Code: Select all
General Error
SQL ERROR [ mysqli ]
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'u.user_id = w.user_id WHERE w.topic_id = 20890 AND (w.notify_stat...' at line 2 [1064]
SQL
SELECT w.user_id as user_id FROM ####_topics_watch w INNER JOIN ####_users u u.user_id = w.user_id WHERE w.topic_id = 20890 AND (w.notify_status = 0 OR (u.user_id = w.user_id AND u.user_primenotify_always_send = 1)) AND w.user_id <> ####
BACKTRACE
FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()
FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 1023
CALL: trigger_error()
FILE: [ROOT]/phpbb/db/driver/mysqli.php
LINE: 195
CALL: phpbb\db\driver\driver->sql_error()
FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 345
CALL: phpbb\db\driver\mysqli->sql_query()
FILE: [ROOT]/ext/primehalo/primenotify/notification/type/post.php
LINE: 61
CALL: phpbb\db\driver\factory->sql_query()
FILE: [ROOT]/phpbb/notification/manager.php
LINE: 273
CALL: primehalo\primenotify\notification\type\post->find_users_for_notification()
FILE: [ROOT]/phpbb/notification/manager.php
LINE: 266
CALL: phpbb\notification\manager->add_notifications()
FILE: [ROOT]/includes/functions_posting.php
LINE: 2400
CALL: phpbb\notification\manager->add_notifications()
FILE: [ROOT]/posting.php
LINE: 1504
CALL: submit_post()
-
- Registered User
- Posts: 667
- Joined: Sat Dec 02, 2006 4:26 pm
Re: 'Email on each new post' problem
There was a missing 'ON'. I have fixed it again
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
-
- Former Team Member
- Posts: 2992
- Joined: Fri May 06, 2005 5:58 pm
- Location: Redding, CA
Re: 'Email on each new post' problem
Thank you! I think that fixed it. It's submitting normally now. Will try it on the live board, but everything looks good.
Thank you so very much!
Thank you so very much!
-
- Registered User
- Posts: 667
- Joined: Sat Dec 02, 2006 4:26 pm