XF 2.2 Adding bulk entries to xf_thread_read to get notifications happening?

bluegreyshoes

New member
Hi, I'm not entirely sure I'm asking the right question, but I've completed an import to XF and users don't get notified when a thread in their pre-existing (from before the import) watched threads is updated. The user_id/thread_id data is present in xf_thread_watch; however I guessing that because they have not visited the thread since the import, there is no entry in xf_thread_read with that user/thread combination and so the notification code effectively interprets this as "the user hasn't visited the thread since they were last updated about it."

And as a result, no notification.

First, is my supposition about what's happening likely to be correct? And second, would a solution be to simply copy the user_id and thread_id from xf_thread_watch into xf_thread_read, setting thread_read_date to now?

Thank you for any info/pointers :)
 
It sounds as though you chose not to notify them of new posts added by the actual import then?

This being the case, I think the answer to your second question would be sort of yes; I think the correct value to use would be the timestamp from the newest post though, rather than now, but now might also work.
 
It sounds as though you chose not to notify them of new posts added by the actual import then?
I'm not... sure I understand the question. Everything was imported, there was no existing content, and all the options were checked in the XF importer. However it's quite possible (likely even) that the source database did not contain the last-visited data, as it itself was the result of a conversion. I missed this particular item in my trial runs.

This being the case, I think the answer to your second question would be sort of yes; I think the correct value to use would be the timestamp from the newest post though, rather than now, but now might also work.
Ah thank you, that sounds like a good idea. I will figure out how to use the last post timestamp.
 
This seems to have done the trick:

Code:
INSERT IGNORE INTO xf_thread_read SELECT 0,w.user_id,w.thread_id,t.last_post_date as thread_read_date FROM xf_thread_watch as w LEFT JOIN xf_thread as t ON w.thread_id=t.thread_id;

Thanks :)
 
I'm not... sure I understand the question. Everything was imported, there was no existing content, and all the options were checked in the XF importer. However it's quite possible (likely even) that the source database did not contain the last-visited data, as it itself was the result of a conversion. I missed this particular item in my trial runs.
Ah OK, I somewhat misunderstood your original post, but happily not in a way that made a major difference :ROFLMAO:

I somehow (crazily, in hindsight!) thought you were importing extra content into existing threads on an existing forum (but without notifying the users watching those threads).
Instead (and based on your comment above) I now understand that you were importing content from a non-XF forum into XF. In that case everything should just have worked, if the importer was doing its job correctly, so as you say the likely cause is that the imported db simply didn't contain the data in question.

If you still have a snapshot of the state from before your fix, a close look at the xf_thread_watch and xf_thread_read might clarify why things weren't behaving as expected.
But that's moot now of course - glad to hear you got it working!
 
Back
Top Bottom