Page MenuHomePhabricator

template redirection breaks edit section links
Closed, ResolvedPublic

Description

Edit section links in a redirected template don't follow redirection, but point
to (nonexistent) sections in the redirect page instead.

Steps to reproduce:

  1. create template A containing at least one section title.
  2. move template to B
  3. transclude A into a page

Actual results:
The [edit] link next to the title of the transcluded section will point to a
section of template A; if you click on the link, you will get an error message
saying the section does not exist.

Expected results:
Either the link should point to the corresponding section of template B in the
first place, or you should be redirected to editing that section upon clicking
on the link.


Version: unspecified
Severity: minor
URL: http://hu.wikipedia.org/w/index.php?title=User:Tgr/teszt&oldid=1559434

Details

Reference
bz9670

Related Objects

Event Timeline

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

ayg wrote:

Something like this should work, added to Linker::editSectionLinkForOther:

if ( $redirect = new Article($title)->followRedirect() && $redirect instanceof
Title ) {

$title = $redirect;

}

I haven't tested it.

The correct fix is probably to get the redirect target at template interpolation
time, when the template title is being base64-substituted into the temporary
expanded code.

Then it'll be the correct value when extracted to make the links.