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

bzimport set Reference to bz27899.
duplicatebug created this task.Via LegacyMar 6 2011, 5:51 PM
Jarry1250 added a comment.Via ConduitMar 16 2011, 9:55 PM

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

Jarry1250 added a comment.Via ConduitMar 16 2011, 10:02 PM

Functional patch v2

This one is actually the patch.

attachment 27899.patch ignored as obsolete

bzimport added a comment.Via ConduitMar 16 2011, 10:07 PM

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.

Jarry1250 added a comment.Via ConduitMar 16 2011, 10:35 PM

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

Attached: 27899.patch

Jarry1250 added a comment.Via ConduitMar 16 2011, 10:54 PM

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.

duplicatebug added a comment.Via ConduitMar 17 2011, 6:06 PM

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

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

Jarry1250 added a comment.Via ConduitMar 17 2011, 7:37 PM

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

duplicatebug added a comment.Via ConduitMar 18 2011, 8:01 PM

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

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

MarkAHershberger added a comment.Via ConduitMar 18 2011, 8:47 PM

Patch applied in r84263

Jarry1250 added a comment.Via ConduitMar 19 2011, 10:30 AM

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