if ( isset( $settings[ApiBase::PARAM_SUBMODULE_PARAM_PREFIX] ) ) {
$item['submoduleparamprefix'] = $settings[ApiBase::PARAM_SUBMODULE_PARAM_PREFIX];
}
+
+ $deprecatedSubmodules = [];
+ foreach ( $item['submodules'] as $v => $submodulePath ) {
+ try {
+ $submod = $this->getModuleFromPath( $submodulePath );
+ if ( $submod && $submod->isDeprecated() ) {
+ $deprecatedSubmodules[] = $v;
+ }
+ } catch ( ApiUsageException $ex ) {
+ // Ignore
+ }
+ }
+ if ( $deprecatedSubmodules ) {
+ $item['type'] = array_merge(
+ array_diff( $item['type'], $deprecatedSubmodules ),
+ $deprecatedSubmodules
+ );
+ $item['deprecatedvalues'] = $deprecatedSubmodules;
+ }
} elseif ( $settings[ApiBase::PARAM_TYPE] === 'tags' ) {
$item['type'] = ChangeTags::listExplicitlyDefinedTags();
} else {
if ( !empty( $settings[ApiBase::PARAM_RANGE_ENFORCE] ) ) {
$item['enforcerange'] = true;
}
+ if ( !empty( $settings[ApiBase::PARAM_DEPRECATED_VALUES] ) ) {
+ $deprecatedValues = array_keys( $settings[ApiBase::PARAM_DEPRECATED_VALUES] );
+ if ( is_array( $item['type'] ) ) {
+ $deprecatedValues = array_intersect( $deprecatedValues, $item['type'] );
+ }
+ if ( $deprecatedValues ) {
+ $item['deprecatedvalues'] = array_values( $deprecatedValues );
+ ApiResult::setIndexedTagName( $item['deprecatedvalues'], 'v' );
+ }
+ }
if ( !empty( $settings[ApiBase::PARAM_HELP_MSG_INFO] ) ) {
$item['info'] = [];
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Parameter_information';
+ return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Parameter_information';
}
}