Watch rollbacks
Closed, ResolvedPublic

Description

Author: sam.korn

Description:
I would like to be able to automatically watchlist all the pages that I rollback
or delete. Is this possible?


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=66215

bzimport set Reference to bz4488.
bzimport created this task.Via LegacyJan 4 2006, 11:41 PM
bzimport added a comment.Via ConduitDec 16 2006, 9:44 PM

robchur wrote:

Watching deletions added in r18381.

bzimport added a comment.Via ConduitJan 6 2007, 6:01 PM

robchur wrote:

I'm inclined to make rollback reuse the existing "watchdefault" preference,
since it's a special case of editing, but I suspect there'll be an uproar if
people's watchlists get flooded. Opinions?

aaron added a comment.Via ConduitJan 6 2007, 6:12 PM

I'd rather it be seperate, as some people do a good deal of RC patrol reverting
random vandalism but also make normal, slower, significant edits to pages they
care about, and it could indeed cause flooding.

bzimport added a comment.Via ConduitJan 7 2007, 12:21 AM

ayg wrote:

And watchdefault can be manually overridden on the edit page with a checkbox,
which it presumably couldn't for rollback.

siebrand added a comment.Via ConduitFeb 2 2009, 12:34 PM

Changed component to "Watchlist"

P.Copp added a comment.Via ConduitFeb 14 2009, 6:29 PM

*** Bug 17481 has been marked as a duplicate of this bug. ***

P.Copp added a comment.Via ConduitFeb 17 2009, 5:25 PM

Proposed patch: Add user preference 'watchrollback'

I assume, nobody is currently working on this, but as it seems quite straightforward to implement, I gave it a try.

Per comment #3 and #4 this patch adds a separate user preference for watching rolled back pages automatically. To make the display page after the rollback work properly, I had to add the methods watch() and unwatch() to the Title class, so $wgTitle->userIsWatching() gives the correct result afterwards. Actually there are some more places, that call $wgUser->addWatch( $title ) which could be replaced now by $title->watch(), but I didn't want to add too much clutter to the patch, so I left it for now.

Of course, any comments are appreciated.

attachment bug4488.patch ignored as obsolete

werdna added a comment.Via ConduitMar 4 2009, 6:17 AM

Proposed patch seems to include a strange movement of watch/unwatch logic to the Title object. This doesn't make sense, because you watch the article, not the title.

  • # If there were errors, bail out now
  • if( !empty( $errors ) )
  • return $errors;
  • return $this->commitRollback($fromP, $summary, $bot, $resultDetails);

+ if( empty( $errors ) ) {
+ $errors = $this->commitRollback($fromP, $summary, $bot, $resultDetails);
+ }
+ if( empty( $errors ) && $wgUser->getOption( 'watchrollback' ) && !$this->mTitle->userIsWatching() ) {
+ $this->doWatch();
+ }
+ return $errors;

I think I like the early bail-out better. It avoids the clutter of checking empty($errors).

Also, you should check count($errors)==0, not empty($errors). empty() is used for a cast to bool with warnings suppressed. If you didn't want to do that, you should use count() explicitly.

It would be cool if you could work the 'create' toggle into the rest of the logic in Preferences, which is quite elegant compared to the current version.

Otherwise, the patch is pretty good. I may fix this stuff up over the coming days and commit it, if you don't get to it first.

P.Copp added a comment.Via ConduitDec 2 2009, 11:46 PM

Updated patch for new pref system

Oops, didn't realize someone commented on this one :D

(In reply to comment #8)

Proposed patch seems to include a strange movement of watch/unwatch logic to
the Title object. This doesn't make sense, because you watch the article, not
the title.

It's rather a small addition than a move. The problem is that the Title object caches, whether the page is watched or not in its member ->mWatched. Currenty, when we watch/unwatch a page, this member is not updated, so any following calls of $title->userIsWatching() will return the wrong result.
So I changed the calls from $wgUser->addWatch( $title ) to $title->watch(), which will update the member var and call $wgUser->addWatch( $this ) itself.

  • # If there were errors, bail out now
  • if( !empty( $errors ) )
  • return $errors;
  • return $this->commitRollback($fromP, $summary, $bot, $resultDetails); + if( empty( $errors ) ) { + $errors = $this->commitRollback($fromP, $summary, $bot, $resultDetails); + } + if( empty( $errors ) && $wgUser->getOption( 'watchrollback' ) && !$this->mTitle->userIsWatching() ) { + $this->doWatch(); + } + return $errors;

    I think I like the early bail-out better. It avoids the clutter of checking empty($errors).

I moved the second if-Statement into the first one now, so I think there shouldn't be a difference anymore.

Also, you should check count($errors)==0, not empty($errors). empty() is used
for a cast to bool with warnings suppressed. If you didn't want to do that, you
should use count() explicitly.

The existing code uses empty, so I didn't really want to change that.

It would be cool if you could work the 'create' toggle into the rest of the
logic in Preferences, which is quite elegant compared to the current version.

With the new pref system this was even easier :)

Attached: bug4488.patch

bzimport added a comment.Via ConduitAug 31 2011, 11:29 PM

john wrote:

Thank for submitting a patch to MediaWiki. I've reviewed the patch, and I don't think moving watch functions into the Title class is the best move here. It would be preferred to update the value of $mWatched from the User class.

duplicatebug added a comment.Via ConduitApr 4 2014, 7:44 PM

FYI: The Extension Echo does this with rollbacks and undos.

Jackmcbarn added a comment.Via ConduitApr 4 2014, 8:04 PM

(In reply to db from comment #11)

FYI: The Extension Echo does this with rollbacks and undos.

I don't think it does.

duplicatebug added a comment.Via ConduitApr 5 2014, 2:26 PM

When visiting the preferences page [[Special:Preferences#mw-prefsection-echo]] there is a option "Edit revert" with the tooltip "Notify me when someone reverts an edit I made, by using the undo or rollback tool.", which I mention.

It is not directly a watch, but you will get a echo ping and can see the rollback/undo. Not perfectly what was requested, but thats why I only added it as info, not changed the state.

Jackmcbarn added a comment.Via ConduitApr 5 2014, 3:12 PM

He's asking for pages that he rolls back to be added to his watchlist, not to be told when someone rolls him back.

gerritbot added a comment.Via ConduitJul 15 2014, 1:11 PM

Change 146440 had a related patch set uploaded by Ebe123:
Create preferences to watchlist pages after rollbacking and undoing

https://gerrit.wikimedia.org/r/146440

gerritbot added a comment.Via ConduitJul 30 2014, 10:19 PM

Change 146440 merged by Legoktm:
Create preference to watchlist pages after rollbacking

https://gerrit.wikimedia.org/r/146440

Ebe123 added a comment.Via ConduitJul 30 2014, 10:24 PM

I hope it's fixed now. (And it should be)

Nemo_bis added a comment.Via ConduitAug 3 2014, 4:03 PM

Thanks for fixing this, it would have fit well in https://www.mediawiki.org/wiki/MediaWiki_1.23#Notifications :-)
This also makes it easier for sysadmins to enable "watchdefault" by default if they wish.

He7d3r added subscribers: He7d3r, jayvdb, Unknown Object (MLST).Via WebJan 19 2015, 2:03 PM

Add Comment