Page MenuHomePhabricator

SkinSubPageSubtitle hook override is broken
Closed, ResolvedPublic

Description

Author: urkle

Description:
In 1.12.0 the subPagesubtitle hook does not work as expected if you return "false" to state "I overrode the implementation use my value"

here is a snip of the code starting from line 843 in file includes/Skin.php

function subPageSubtitle() {
          $subpages = '';
          if(!wfRunHooks('SkinSubPageSubtitle', array(&$subpages)))
                  return $retval;

          global $wgOut, $wgTitle, $wgNamespacesWithSubpages;
          if($wgOut->isArticle() && !empty($wgNamespacesWithSubpages[$wgTitle->getNamespace()])) {
                  $ptext=$wgTitle->getPrefixedText()

Note that if !wfRunHooks then $retval is returned, which is an undefined variable.

It *should* return $subpages.


Version: 1.12.x
Severity: enhancement

Details

Reference
bz14212

Event Timeline

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

Stupid mistake, I wrote a lot of "return $retval;" around that time. Fixed in r35145.