Contact Admin

Setting of watch flag on topics created by extension - Contact Admin

Setting of watch flag on topics created by extension

by v12mike » Tue May 28, 2019 5:29 am

While examining the database on a forum for a problem unrelated to this extension, I noticed that every topic created by this extension where the contacting user was logged-in had generated an entry in the topics_watch table (for the contacting user).

This is generally a waste of space, as the originating user would not usually have access to the forum where the message is posted.

I see in the extension source code:

Code: Select all

							'notify_set'		=> false,
							'notify'			=> true,
which in functions_posting.php gets interpreted by:

Code: Select all

		if (!$data_ary['notify_set'] && $data_ary['notify'])
		{
			$sql = 'INSERT INTO ' . TOPICS_WATCH_TABLE . ' (user_id, topic_id)
				VALUES (' . $user->data['user_id'] . ', ' . $data_ary['topic_id'] . ')';
			$db->sql_query($sql);
		}
I would suggest that 'notify' should be set to false, or 'notify_set' should be set to true (the logic of that variable name escapes me).
v12mike
Registered User
Posts: 347
Joined: Thu Jul 09, 2015 5:03 pm
Contact: