mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
synced 2024-11-13 17:53:17 +00:00
Revert "Directly use $wgTitle instead of relying on getContextTitle fallback"
This reverts commit b3fb04b463
.
The problem is *not* getContextTitle() - that's the correct
function to call here. The problem is that something is creating
an EditPage instance without calling setContextTitle() - that's
what needs to be fixed.
Change-Id: Ibc8280c7434bee4c4697142bcdbc1194f00c53c1
This commit is contained in:
parent
b3fb04b463
commit
212477a083
|
@ -1,8 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset>
|
||||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
|
||||
<exclude name="MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle" />
|
||||
</rule>
|
||||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
|
||||
<file>.</file>
|
||||
<arg name="extensions" value="php,php5,inc" />
|
||||
<arg name="encoding" value="UTF-8" />
|
||||
|
|
|
@ -41,12 +41,11 @@ class CodeEditorHooks {
|
|||
* @throws ErrorPageError
|
||||
*/
|
||||
public static function editPageShowEditFormInitial( EditPage $editpage, OutputPage $output ) {
|
||||
global $wgTitle;
|
||||
|
||||
$title = $editpage->getContextTitle();
|
||||
$model = $editpage->contentModel;
|
||||
$format = $editpage->contentFormat;
|
||||
|
||||
$lang = self::getPageLanguage( $wgTitle, $model, $format );
|
||||
$lang = self::getPageLanguage( $title, $model, $format );
|
||||
if ( $lang && $output->getUser()->getOption( 'usebetatoolbar' ) ) {
|
||||
$output->addModules( 'ext.codeEditor' );
|
||||
$output->addJsConfigVars( 'wgCodeEditorCurrentLanguage', $lang );
|
||||
|
|
Loading…
Reference in a new issue