Difference between revisions of "Extension talk:CategoryWatch"

From Organic Design wiki
(User friendly message: make generic)
m (User friendly message)
Line 24: Line 24:
 
Dear Foo,
 
Dear Foo,
  
the Foo Wiki page Foo has been changed on 19:03, 5 March 2009 by Baz, see http://foo.bar/Foo for the current version.
+
the Foo Wiki page Foo has been changed on 19:03, 5 March 2009 by Baz,
 +
see http://foo.bar/Foo for the current version.
  
 
See http://foo.bar?title=Foo&diff=0&oldid=26491 for all changes since your last visit.
 
See http://foo.bar?title=Foo&diff=0&oldid=26491 for all changes since your last visit.
Line 32: Line 33:
 
Contact the editor: mail: http://foo.bar/Special:Emailuser/Baz wiki: http://foo.bar/User:Baz
 
Contact the editor: mail: http://foo.bar/Special:Emailuser/Baz wiki: http://foo.bar/User:Baz
  
There will be no other notifications in case of further changes unless you visit this page. You could also reset the notification flags for all your watched pages on your watchlist.
+
There will be no other notifications in case of further changes unless you visit this page.
 +
You could also reset the notification flags for all your watched pages on your watchlist.
  
 
             Your friendly Foo Wiki notification system
 
             Your friendly Foo Wiki notification system

Revision as of 03:46, 20 April 2009

A feature that's missing from the MediaWiki Watchlist functionality is that if you watch a category page, you will only be notified when the content of the category page text changes. You won't be notified when pages are added to or removed from that category though which is probably the main information you were wanting.

It would be nice if, in addition to the normal behaviour, a message could be sent to the user listing the added and/or removed member articles.

This functionality would need to be added to the ArticleSaveComplete hook. The category links should be recorded at the start of the request if action is "submit", and then checked against that original state after the article is saved, if its changed, the notification message is sent (preferably using the same code as the normal Watchlist functionality).

Development notes

The notifyOnPageChange method in the EmailNotification class (in UserMailer.php), handles the mailing out of the notifications to all watching users, it takes $editor, $title, $timestamp, $summary and $minor parameters. The composeCommonMailtext method sets the EmailNotification object's from, replyto, subject and body properties using the enotif_body and enotif_subject messages.

So the simplest implementation would be to hook in to ArticleSaveComplete where it creates a list of affected categories with a message for each, then changes the enotif_body and enotif_subject messages, calls notifyOnPageChange, then restores the messages again. To assess the affected categories, it needs to know the content of the previous revision, or perhaps it can record the category links before and after being updated.

Error in mediaWiki-1.13.2

Fatal error: Cannot redeclare wfsetupcategorywatch() (previously declared in /var/www/extensions/CategoryWatch /CategoryWatch.php:163) in /var/www/extensions/CategoryWatch/CategoryWatch.php on line 179(http://setup.organicdesign.co.nz/wiki/index.php)

Resolved, this extension was declared twice as it is in general extensions --Sven 21:49, 22 October 2008 (NZDT)

This could be due to an old versionbeing run on OD which currently contains a bug --Sven 21:39, 22 October 2008 (NZDT)

User friendly message

Make a better message with more information in it using a lot of the same code as EmailNotification::composeCommonMailtext() in includes/UserMailer.php.

The normal watched article notification content is as follows:

Dear Foo,

the Foo Wiki page Foo has been changed on 19:03, 5 March 2009 by Baz,
see http://foo.bar/Foo for the current version.

See http://foo.bar?title=Foo&diff=0&oldid=26491 for all changes since your last visit.

Editor's summary: -

Contact the editor: mail: http://foo.bar/Special:Emailuser/Baz wiki: http://foo.bar/User:Baz

There will be no other notifications in case of further changes unless you visit this page.
You could also reset the notification flags for all your watched pages on your watchlist.

            Your friendly Foo Wiki notification system

-- To change your watchlist settings, visit http://foo.bar/Special:Watchlist/edit

Feedback and further assistance: http://foo.bar/Help:Contents