FIX: Link notification to first unread post (PR #12868)

If a topic with a few posts was posted in a watched category, the created notification would always point to the last post, instead of pointing to the first one.

The root cause is that the query that fetched the first unread post uses ‘TopicUser’ records and those are not created by default for user watching the category. In this case, it should use the ‘CategoryUser’ record.


You should use named parameters, because positional parameters are very unfriendly when there are more than 3.