From df65f09669bca9fe4a2c3fd8d3f69d6acabaf41b Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 30 Apr 2020 07:46:02 +1000 Subject: [PATCH] Revert "Correct capitalization of BeforeParserFetchTemplateAndTitle hook" In the new hook system, it is invalid to have two hooks that differ only in case. This reverts commit afb5b38e15d9d864913164be9681c6417eb2f4e7. Change-Id: I160ece0a7bc68c748037b383137364b787be86a0 --- RELEASE-NOTES-1.35 | 3 --- docs/hooks.txt | 9 +-------- includes/parser/Parser.php | 2 -- maintenance/benchmarks/benchmarkParse.php | 2 +- maintenance/preprocessorFuzzTest.php | 2 +- 5 files changed, 3 insertions(+), 15 deletions(-) diff --git a/RELEASE-NOTES-1.35 b/RELEASE-NOTES-1.35 index a5c50cd10ce..81e87d6cc91 100644 --- a/RELEASE-NOTES-1.35 +++ b/RELEASE-NOTES-1.35 @@ -189,7 +189,6 @@ For notes on 1.34.x and older releases, see HISTORY. Support for not passing a user has also been hard-deprecated and will be removed in 1.36. * The ParserPreSaveTransformComplete hook was added. -* The BeforeParserFetchTemplateAndTitle hook was added. * The ParserBeforePreprocess hook was added. * The ResourceLoaderSkinModule class now has a "legacy" feature that loads the stylesheets previously part of the "mediawiki.legacy.shared" and @@ -941,8 +940,6 @@ because of Phabricator reports. * No replacement; Content::preSaveTransform() provides for customizable PSTs - BeforeParserrenderImageGallery * No replacement; MediaHandler provides for customizable media rendering - - BeforeParserFetchTemplateAndtitle - * Replace with new BeforeParserFetchTemplateAndTitle hook - ParserBeforeTidy * Use ParserAfterTidy instead to avoid exposing internal half-parsed state * The accessor/mutator methods Parser::Options(), Parser::OutputType(), and diff --git a/docs/hooks.txt b/docs/hooks.txt index 9e2a4660137..3b0ded9da93 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -849,14 +849,7 @@ $nt: the image title as a key then the file will appear as a broken thumbnail. &$descQuery: query string to add to thumbnail URL -'BeforeParserFetchTemplateAndtitle': DEPRECATED since 1.35! -Use the version with corrected capitalization below. -$parser: Parser object -$title: title of the template -&$skip: skip this template and link it? -&$id: the id of the revision being parsed - -'BeforeParserFetchTemplateAndTitle': Before a template is fetched by Parser. +'BeforeParserFetchTemplateAndtitle': Before a template is fetched by Parser. $parser: Parser object $title: title of the template &$skip: skip this template and link it? diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 9121e11be9c..5fbd176127d 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3554,8 +3554,6 @@ class Parser { # Give extensions a chance to select the revision instead $id = false; # Assume current Hooks::run( 'BeforeParserFetchTemplateAndtitle', - [ $parser, $title, &$skip, &$id ], '1.35' ); - Hooks::run( 'BeforeParserFetchTemplateAndTitle', [ $parser, $title, &$skip, &$id ] ); if ( $skip ) { diff --git a/maintenance/benchmarks/benchmarkParse.php b/maintenance/benchmarks/benchmarkParse.php index 40b03ecbc93..4879ed60dd3 100644 --- a/maintenance/benchmarks/benchmarkParse.php +++ b/maintenance/benchmarks/benchmarkParse.php @@ -70,7 +70,7 @@ class BenchmarkParse extends Maintenance { public function execute() { if ( $this->hasOption( 'tpl-time' ) ) { $this->templateTimestamp = wfTimestamp( TS_MW, strtotime( $this->getOption( 'tpl-time' ) ) ); - Hooks::register( 'BeforeParserFetchTemplateAndTitle', [ $this, 'onFetchTemplate' ] ); + Hooks::register( 'BeforeParserFetchTemplateAndtitle', [ $this, 'onFetchTemplate' ] ); } $this->clearLinkCache = $this->hasOption( 'reset-linkcache' ); diff --git a/maintenance/preprocessorFuzzTest.php b/maintenance/preprocessorFuzzTest.php index 943011b3dd4..addf09644a7 100644 --- a/maintenance/preprocessorFuzzTest.php +++ b/maintenance/preprocessorFuzzTest.php @@ -28,7 +28,7 @@ use Wikimedia\TestingAccessWrapper; $optionsWithoutArgs = [ 'verbose' ]; require_once __DIR__ . '/commandLine.inc'; -$wgHooks['BeforeParserFetchTemplateAndTitle'][] = 'PPFuzzTester::templateHook'; +$wgHooks['BeforeParserFetchTemplateAndtitle'][] = 'PPFuzzTester::templateHook'; class PPFuzzTester { public $hairs = [