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 afb5b38e15.

Change-Id: I160ece0a7bc68c748037b383137364b787be86a0
This commit is contained in:
Tim Starling 2020-04-30 07:46:02 +10:00
parent 9b245450f0
commit df65f09669
5 changed files with 3 additions and 15 deletions

View file

@ -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

View file

@ -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?

View file

@ -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 ) {

View file

@ -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' );

View file

@ -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 = [