jenkins-bot has submitted this change and it was merged. Change subject: Allow hook subscribers to also overwrite link to title ......................................................................
Allow hook subscribers to also overwrite link to title Flow, for example, has those totally illegible Titles like Topic:S0gx52fzru1680ib - instead, we'd rather use the topic title content as link text. Change-Id: I30b3bbb2c5ef131f069a5aabfad8b88bc2cf09df --- M RELEASE-NOTES-1.24 M docs/hooks.txt M includes/specials/SpecialEditWatchlist.php 3 files changed, 9 insertions(+), 6 deletions(-) Approvals: EBernhardson: Looks good to me, approved jenkins-bot: Verified diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index cd4e668..09133f7 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -67,6 +67,8 @@ instead. === New features in 1.24 === +* Added new argument &$link in hook WatchlistEditorBuildRemoveLine, allowing the + link to the title to be changed. * Added a new hook, "WhatLinksHereProps", to allow extensions to annotate WhatLinksHere entries. * Added a new hook, "ContentGetParserOutput", to customize parser output for diff --git a/docs/hooks.txt b/docs/hooks.txt index d704eb5..106884b 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2944,6 +2944,7 @@ $title: Title object $redirect: whether the page is a redirect $skin: Skin object +&$link: HTML link to title 'WebRequestPathInfoRouter': While building the PathRouter to parse the REQUEST_URI. diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index 76f2f4a..73438d9 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -620,11 +620,6 @@ private function buildRemoveLine( $title ) { $link = Linker::link( $title ); - if ( $title->isRedirect() ) { - // Linker already makes class mw-redirect, so this is redundant - $link = '<span class="watchlistredir">' . $link . '</span>'; - } - $tools[] = Linker::link( $title->getTalkPage(), $this->msg( 'talkpagelinktext' )->escaped() ); if ( $title->exists() ) { @@ -645,9 +640,14 @@ wfRunHooks( 'WatchlistEditorBuildRemoveLine', - array( &$tools, $title, $title->isRedirect(), $this->getSkin() ) + array( &$tools, $title, $title->isRedirect(), $this->getSkin(), &$link ) ); + if ( $title->isRedirect() ) { + // Linker already makes class mw-redirect, so this is redundant + $link = '<span class="watchlistredir">' . $link . '</span>'; + } + return $link . " (" . $this->getLanguage()->pipeList( $tools ) . ")"; } -- To view, visit https://gerrit.wikimedia.org/r/156118 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I30b3bbb2c5ef131f069a5aabfad8b88bc2cf09df Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Matthias Mullie <mmul...@wikimedia.org> Gerrit-Reviewer: EBernhardson <ebernhard...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits