Page MenuHomePhabricator

Link to rights logs for users when using Special:userrights
Closed, ResolvedPublic

Description

Author: fearow00

Description:
The code

This is my first attempt at a patch for MediaWiki, so it is a small change.

This patch adds a (view log) link next to the users name on Special:userrights. This interface is used usually by stewards. The text is cusomizable by the system message "userrights-loglinktext", which by default is set to "view log".

Thanks!


Version: 1.11.x
Severity: enhancement

attachment specialuserrightsLogLink.patch ignored as obsolete

Details

Reference
bz10404

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:54 PM
bzimport set Reference to bz10404.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

You seem to be calling a parse operation in order to build a simple link. Investigate the Linker and Skin classes.

fearow00 wrote:

(In reply to comment #1)

You seem to be calling a parse operation in order to build a simple link.
Investigate the Linker and Skin classes.

Ok, is the parse operation too expensive? I'll try it another way.

robchur wrote:

By comparison, yes. It's also a very sloppy way of doing it - we don't build UI links in that fashion.

I would recommend that, rather than just linking to the rights log, you investigate the possibility of adding the log fragment at the bottom of the page when a valid target is specified.

fearow00 wrote:

(In reply to comment #3)

By comparison, yes. It's also a very sloppy way of doing it - we don't build UI
links in that fashion.

I would recommend that, rather than just linking to the rights log, you
investigate the possibility of adding the log fragment at the bottom of the
page when a valid target is specified.

I'll investigate adding a fragment on the bottom, I don't know whether this would invlove similair things to transclusion, i'm supposing I can't just go $wgOut->parse("{{Special:Log/rights?page=User:NAME}");.

I am attaching another patch, using Linker as well as several other tweaks. It works a lot better now.

fearow00 wrote:

Patch V2

attachment specialuserrightsLogLink_v2.patch ignored as obsolete

robchur wrote:

You don't instantiate Linker; use a Skin instead. The current user's Skin can be obtained using $GLOBALS['wgUser']->getSkin()

fearow00 wrote:

Patch V3

This has some benefits, it shows the log in the page, and is properly customizable. It also uses the users skin instead of a new Linker.

Attached:

robchur wrote:

Fixed in r23580. I couldn't use the provided patch, however; it didn't honour the safe construction of localised titles, abused Linker::makeKnownLink() [deprecated], and contained odd bits like appending a misplaced </div> in the log fragment function.