Watching a page with a journal block
Bug #1401210 reported by
Stéphane
This bug affects 4 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Wishlist
|
Aaron Wells |
Bug Description
A page of user A is on the watchlist of user B.
The page contains a journal block. When user A updates is journal by adding a new article, the new article is displayed in the page but there is no notification to user B that user A has updated is journal.
This situation is the same with a journal block, a recent journal entry block and tagged journal entry block.
It would be nice either to have the option to add the block to the watchlist, specifically or to make sure that when a page is on a watchlist all modifications including a new journal entry in a block trigger a notification.
tags: | added: blog watchlist |
Changed in mahara: | |
status: | New → Confirmed |
Changed in mahara: | |
importance: | Undecided → Wishlist |
tags: | removed: snack-sized |
Changed in mahara: | |
status: | Confirmed → Fix Committed |
Changed in mahara: | |
assignee: | nobody → Aaron Wells (u-aaronw) |
tags: | added: nominatedfeature |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Thanks for the bug report!
I think I've identified the coding issue that causes this problem. Whenever an artefact (including a blog post) gets updated, it calls PluginArtefact: :commit( ), which fires off a "saveartefact" event handler, which in turn fires off the "watchlist_ record_ changes( )" method in lib/activity.php
It then identifies all the pages that the artefact is in, according to the view_artefact table. The view_artefact table gets populated by the PluginBlocktype ::rebuild_ artefact_ list() function whenever a block instance is saved, and it tells the block to look at which artefact's it's using, which view it's in, and fill that into the table.
Crucially, the "blog" artefact has its own extra code that invokes rebuild_ artefact_ list() whenever a blog entry artefact is committed. But, judging by the comments in the code, it was only written to look at "journal post" and "journal" blocks, and not to consider the other journal blocks (recent journal entry, tagged journal entry). And apparently it's not handling the "journal" block correctly either.
The place this happens is in the blog artefact's own commit() method (which extends the PluginArtefact: :commit( ) method). So, it should be a fairly simple matter to fix it there.