Page MenuHomePhabricator

$wgShortUrlTemplate option not functional
Closed, InvalidPublic

Description

Author: daniel

Description:
ShortUrl patch to make $wgShortUrlTemplate function

The ShortUrl extension documents a capability by which you can change the default path of a short URL, normally .../Special:ShortUrl/NNNN

This is to be achieved by setting a global variable $wgShortUrlTemplate, specifying the path component to use instead of the default.

e.g.

$wgShortUrlTemplate = "/r/$1";

This would make the path .../r/NNNN

This capability simply doesn't work.

Examining the code, the extension clobbers $wgShortUrlTemplate, replacing it with the default value (false).

The attached patch file suggests a fix and adds minor doc/comment cleanup.


Version: master
Severity: normal

Attached:

Details

Reference
bz61838

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:06 AM
bzimport set Reference to bz61838.

Thanks for your patch!

You are welcome to use Developer access

https://www.mediawiki.org/wiki/Developer_access

to submit this as a Git branch directly into Gerrit:

https://www.mediawiki.org/wiki/Git/Tutorial

Putting your branch in Git makes it easier to review it quickly. If you don't want to set up Git/Gerrit, you can also use https://tools.wmflabs.org/gerrit-patch-uploader/

daniel wrote:

Actually, as I'm a n00b, I think this might not be a bug, after all. I was presuming that extension configuration values should be settable along with all other configuration values, but it looks like they might generally need to be set after the extension is loaded. If that's done, everything works as expected.

daniel wrote:

Not a bug. Config values need to be *after* the require_once statement, as described at Manual:Extensions.