I9fc7640ecbc61cb82265899a9fd8ff8e51e09908 and its cherry picks introduces a change in how onSelfLinkBegin hook makes links.
Previous code:
public function onSelfLinkBegin( $nt, &$html, &$trail, &$prefix, &$ret ) {
// Do not use DisplayTitle if current page is defined in $wgDisplayTitleExcludes
$request = $this->config->get( 'Request' );
$title = $request->getVal( 'title' );
if ( in_array( $title, $GLOBALS['wgDisplayTitleExcludes'] ) ) {
return;
}
self::handleLink( $nt, $html, false );
}New code:
public function onSelfLinkBegin( $nt, &$html, &$trail, &$prefix, &$ret ) {
$request = $this->config->get( 'Request' );
$title = $request->getVal( 'title' );
$this->displayTitleService->handleLink( $title, $nt, $html, false );
}Notable difference:
If title is not given (Because e.g. you are parsing several pages as part of a script or something) it might be that $config->get('Request')->getVal('title) is null, which will error out in the new code with "TypeError: null given should be string".
I suggest we do one of the following:
- Get title from target. It is a self-link after all
- put ?string inside handleLink
Our problem occurred when using PageSync extension for syncing several pages, which will be parsed during save without $config->get('Request')->getVal('title'); being set.