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
duplicatebug | |
Mar 6 2011, 5:51 PM |
F7916: 27899.patch | |
Nov 21 2014, 11:36 PM |
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
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.
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
Sorry, the diff is shown very small on my screen.
Maybe use ChangesList::isDeleted instead of creating a new Revision object.
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?