Deleting post removes topic from topic_watch table [2.0.11]

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
petes
Registered User
Posts: 72
Joined: Thu Feb 19, 2004 11:21 pm

Deleting post removes topic from topic_watch table [2.0.11]

Post by petes » Sun Dec 26, 2004 12:00 am

I'm seeing this in 2 different installations that otherwise seem to be perfect. If user A logs in and watches a topic, then user B logs in and posts to that topic, then deletes the post, all entries for that topic ID number in the topic_watch table are removed.

Only thing odd might be that I am using 2 computers coming from the same IP number... but that's not part of the data in the topic-watch table.

Can some others test to see if this is happening to them?

[I searched for similar posts but found none. Bug tracker's down or I would have looked there too.]

Thanks, Pete

User avatar
pentapenguin
Former Team Member
Posts: 11030
Joined: Thu Jul 01, 2004 4:15 am
Location: GA, USA

Post by pentapenguin » Sun Dec 26, 2004 12:01 am

If the topic is deleted, then there's no point in watching it. ;)
Support Resources: Support Request Template
If you need professional assistance with your board, please contact me for my reasonable rates.

petes
Registered User
Posts: 72
Joined: Thu Feb 19, 2004 11:21 pm

Post by petes » Sun Dec 26, 2004 12:09 am

No, no no... guess I wasn't clear.

Just deleting the last post... not all posts. I tested in a topic with one post in it by a third user. I poasted after him, then I deleted the last post (second, or third post int he topic in these cases). The result is the watch-topic table loses all entries for that topic for all users.

...but you comment does give me an idea... I wonder if the board is looking at the last post as though it were the first (topic starting) post, and thus deleteing all watch_topic entries for the topic... (I'll test this by deleting a "middle" post as admin and see what happens.)

petes
Registered User
Posts: 72
Joined: Thu Feb 19, 2004 11:21 pm

Post by petes » Sun Dec 26, 2004 12:47 am

As an update...

I find that if I create a topic, put three posts in it, and delete the last entry in it, it removes the entries for that topic in the watch_topic table. But I can remove the forst or middle post, and the table is not effected...

Need to look at the code for deleteing watches/deleting posts to see if something is backward. Anyone have an idea...?

petes
Registered User
Posts: 72
Joined: Thu Feb 19, 2004 11:21 pm

Post by petes » Sun Dec 26, 2004 8:43 am

Update #2

I got to thinking that it might be a mod, even though I don't think any of them should have this effect. So I tried it by creating a test topic on this board (in the Test Me forum, where I have delete priviledges). Then I Watched it, then posted again, then deleted ONLY the last post... and when I go back to the topic, I'm *not* watching it any longer...

FYI: installed MODS are...
Admin_userlist_202
Easy_assign_users_to_groups_1-0-6
Import_Tools_beta_0.1.4
topics_anywhere_1110
phpbb_fetch_all-2.0.3
prevent_reply_notifications_to_unauthorized_users_1-0-3

petes
Registered User
Posts: 72
Joined: Thu Feb 19, 2004 11:21 pm

Post by petes » Tue Dec 28, 2004 12:50 am

*bump*

Need an answer to this, it's really important for how I use one of my boards. If it's a 2.0.11 code problem, I need to find a fix. If it's not, or if i'm just plain imagining the problem I need to know that too. ;)

I have a test in mind... I'm currently watching this topic. Someone else watch it too, then post to it, then delete the post. Then post the results as to whether you are still watching it adter the delete. Then I'll see if it deleted my wath as well. (Because that's what I think is happening... all watches for a topic get removed if the last post is deleted... by anyone, poster or Admin.)

User avatar
Khurram
Registered User
Posts: 60
Joined: Sat Dec 11, 2004 2:09 pm
Contact:

Post by Khurram » Tue Dec 28, 2004 4:14 am

As I understand, watch topic works like:

1. You post in a forum. You automatically get added to the watch list. So as soon as anyone replies to the same forum i.e adds a post after your's, you get an email that you are watching this topic and someone replied.

2. Now if you dont visit that link, or even if you dont unwatch it from the email link, still you DONT get any more emails even if someone posts a 3rd post.

3. So unless you visit it for the first reply after your's you are automatically unwatched (or like in a queue till you visit that topic).

4. If you dont select the option to unwatch it yourself from the email, you keep getting notified whenever a reply is made (subject to your visiting the watch topic link everytime on each notification).

Now that was my understanding of how it originally works. To test your theory, lets try it. So this is my test post for you. Lets see. After this you can post one, and delete it. And we will see if we get any more watch notices or not. That would confirm your theory, as I understood it.

petes
Registered User
Posts: 72
Joined: Thu Feb 19, 2004 11:21 pm

Post by petes » Tue Dec 28, 2004 6:55 am

You are correct that you only get notified ONCE of new posts in between visits. The problem I am talking about is different... if you are watching a topic, it should stay that way until you unwatch it. But what I see happening is if someone deletes the last post it removes the entry in the watched topics table, not just that user, but for all users.

So go ahead, post a test in this topic, then delete it. You'll see you are no longer watching this topic, neither will I be watching it. Then post that you have done so (or PM me) so I can varify that I am no longer watching it either. I've done this test on my own boards and watched the entries be removed from the db table.

User avatar
Khurram
Registered User
Posts: 60
Joined: Sat Dec 11, 2004 2:09 pm
Contact:

Post by Khurram » Tue Dec 28, 2004 8:55 am

done. posted and deleted a message before this one. lets see. so now if you post a reply to this, we shouldnt be getting anymore notifications ? that would confirm it.

petes
Registered User
Posts: 72
Joined: Thu Feb 19, 2004 11:21 pm

Post by petes » Tue Dec 28, 2004 9:24 am

Yes you did post/delete, and as a result I am no longer listed as watching this topic. I assume you noticed that after deleting the post, that going back to the topic showed "Watch this topic for replies" at th ebottom (indicating you are not watching it), and NOT "Stop watching...".

The email notify that I did get was for the post you deleted, #1370590. I'll PM you that I posted this one since you won't get an email (unless you re-watched the topic already).

petes
Registered User
Posts: 72
Joined: Thu Feb 19, 2004 11:21 pm

Post by petes » Tue Dec 28, 2004 7:33 pm

In functions_post.php, in the function "user_notification" I find:

Code: Select all

	if ($mode == 'delete')
	{
		$delete_sql = (!$post_data['first_post'] && !$post_data['last_post']) ? " AND user_id = " . $userdata['user_id'] : '';
		$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " WHERE topic_id = $topic_id" . $delete_sql;
		if (!$db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, 'Could not change topic notify data', '', __LINE__, __FILE__, $sql);
		}
	}
I'm assuming the problem has to be in this block...? I only found one use of the function "user_notification" and that was is posting.php But are there other places, such as things done by mods? If so I couldn't find it...

I'm hoping for some support team input before I have to start "playing" with code myself... not having a total understanding of the logical layout of phpBB is a big limitation...

Can I get some help here?

petes
Registered User
Posts: 72
Joined: Thu Feb 19, 2004 11:21 pm

Post by petes » Fri Dec 31, 2004 8:10 pm

I can't seem to get any real help here... I've tested this on 3 working boards, and this board, and a new un-modded board... all seem to confirm what I'm saying.

Maybe no one else cares about the watch topic functionality?! I doubt that.

I'm going to start a new Thread with a different Subject to see if that will get anyone's attention.

petes
Registered User
Posts: 72
Joined: Thu Feb 19, 2004 11:21 pm

Post by petes » Sat Jan 01, 2005 8:45 pm

Could I get some other users to test this out on their own boards to see if they can duplicate the problem. It seems clearly documented and duplicatable to me, but maybe I'm missing something.

Thanks

User avatar
Khurram
Registered User
Posts: 60
Joined: Sat Dec 11, 2004 2:09 pm
Contact:

Post by Khurram » Fri Jan 07, 2005 9:55 am

lets see. i havent WATCHED this topic yet. so if you reply to it and I get a message, your theory goes wrong. Else its proved. (I deleted my mails earlier so not sure if I got a reply to your posts or not.. actually I had two notifications on 28th dec. so not sure).

And till someone gives an official word on your theory, I actually disabled user's right to delete posts on all the forums i manage. Lets see. Maybe you made me did overtime on weekend ! or maybe you helped saving the forums from getting slower for people thinking no one replied to their post.

Edit: After posting this message, I saw that actually it still says "Stop watching this topic" .. hmm cause I deleted and posted a new message earlier ? so it automatically added me ?

petes
Registered User
Posts: 72
Joined: Thu Feb 19, 2004 11:21 pm

Post by petes » Fri Jan 07, 2005 6:25 pm

Yes that's why, you have your profile set to watch all topics you post in by default. (I didn't catch that earlier, which explains some of you comments.) But I'm seeing it delete (stop) watches from a delete action. Here's how you (we) can test this:

I'm watching this topic now. So are you, now please post a test message in this thread (that should send us both an email), then go right back delete that last test post. What I have been seeing is that neither of us will then be watching the topic. If you post and delete, then go back to the topic you won't be watching it anymore. (Then if you post it will add you back-but according to my testing, all others will no longer be watching it.)

Please try it and we'll see what happens... if I am still watching it after you delete, then I am missing something.

Locked

Return to “2.0.x Support Forum”