When bookmarking an item besides topic/post (e.g. chat), the post_id in the activity cell of /activity/bookmarks will be underfined, after the lastPostUrl(highestPostNumber)function, the highest_post_number will be /t/undefined, and linking to the Access Denied while trying to load /t/id_for/undefined You're not allowed to view that. page.
This commit changed the link under such circumstance to the exactthis.bookmarkable_url, so that the issue is solved.