Special:NewPages does not handle RevisionDeletion
Closed, ResolvedPublic

Description

Special:NewPages does not handle RevisionDeletion.

This means the hidden comment of a new created page is shown and the hidden user of a new created page is also shown.


Version: 1.18.x
Severity: major

Details

Blocks
T20840: RevDelete/HideUser (tracking)
Reference
bz27899
bzimport set Reference to bz27899.

Functional patch v1

A nice little patch to fix this. Slightly hackish, I suppose, but neat and functional nonetheless.

attachment SpecialNewpages.php ignored as obsolete

Functional patch v2

This one is actually the patch.

attachment 27899.patch ignored as obsolete

Bryan.TongMinh wrote:

I haven't looked in detail to the code, but I think you need to move the construction of the Revision object higher up so that you can also hide rc_user_text.

Also check whether the construction of a Revision object does cause an extra SQL query. Perhaps it is best to use Revision::selectFields() (not sure of the exact name) to get the required select fields.

Patch v3: Handle revdel'd usernames as well as comments

Attached: 27899.patch

Oh, and no, Revision::construct() takes a database query result as a possible input (or an array, as here), it does not run its own, AFAICT.

recentchanges table has a rc_deleted field, which should work here.

http://www.mediawiki.org/wiki/Manual:Recentchanges_table#rc_deleted

That's what I'm using in the patch :)

Sorry, the diff is shown very small on my screen.

Maybe use ChangesList::isDeleted instead of creating a new Revision object.

Patch applied in r84263

Duplicatebug: That would be slightly more appropriate, agreed. However, since ChangesList isn't really set up for that, I think that may be the case of moving from one imperfect solution to another for only a slight gain.

Maybe the preferable option would be to extend the capabilities of the Linker to handle both RC and Revision objects passed to it, then take ChangesList and NewPages over to using that. Much neater :) What do you think?

Add Comment