X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiHelp.php;h=78efe4191bf040b67792bb482403696097ccae1a;hb=871d947ca43c5876d4be2bf02ebb86a9c59ad98d;hp=84fcbeff7bbb52dbf0502abde1406371e060825f;hpb=a479750da672066b4189b115d1141a23d8c5cae3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiHelp.php b/includes/api/ApiHelp.php index 84fcbeff7b..78efe4191b 100644 --- a/includes/api/ApiHelp.php +++ b/includes/api/ApiHelp.php @@ -102,7 +102,6 @@ class ApiHelp extends ApiBase { 'mediawiki.apihelp', ] ); if ( !empty( $options['toc'] ) ) { - $out->addModules( 'mediawiki.toc' ); $out->addModuleStyles( 'mediawiki.toc.styles' ); } $out->setPageTitle( $context->msg( 'api-help-title' ) ); @@ -560,11 +559,9 @@ class ApiHelp extends ApiBase { $arr = &$submodules; try { $submod = $module->getModuleFromPath( $m ); - if ( $submod ) { - if ( $submod->isDeprecated() ) { - $arr = &$deprecatedSubmodules; - $attrs['class'] = 'apihelp-deprecated-value'; - } + if ( $submod && $submod->isDeprecated() ) { + $arr = &$deprecatedSubmodules; + $attrs['class'] = 'apihelp-deprecated-value'; } } catch ( ApiUsageException $ex ) { // Ignore @@ -586,7 +583,8 @@ class ApiHelp extends ApiBase { break; case 'namespace': - $namespaces = MWNamespace::getValidNamespaces(); + $namespaces = MediaWikiServices::getInstance()-> + getNamespaceInfo()->getValidNamespaces(); if ( isset( $settings[ApiBase::PARAM_EXTRA_NAMESPACES] ) && is_array( $settings[ApiBase::PARAM_EXTRA_NAMESPACES] ) ) {