* 1.27+: IApiMessage, or a key or key+parameters in ApiBase::$messageMap.
* Earlier: A key or key+parameters in ApiBase::$messageMap.
+'ApiDeprecationHelp': Add messages to the 'deprecation-help' warning generated
+from ApiBase::addDeprecation().
+&$msgs: Message[] Messages to include in the help. Multiple messages will be
+ joined with spaces.
+
'APIEditBeforeSave': DEPRECATED! Use EditFilterMergedContent instead.
Before saving a page with api.php?action=edit, after
processing request parameters. Return false to let the request fail, returning
$this->logFeatureUsage( $feature );
}
$this->addWarning( $msg, 'deprecation', $data );
+
+ // No real need to deduplicate here, ApiErrorFormatter does that for
+ // us (assuming the hook is deterministic).
+ $msgs = [ $this->msg( 'api-usage-mailinglist-ref' ) ];
+ Hooks::run( 'ApiDeprecationHelp', [ &$msgs ] );
+ if ( count( $msgs ) > 1 ) {
+ $key = '$' . join( ' $', range( 1, count( $msgs ) ) );
+ $msg = ( new RawMessage( $key ) )->params( $msgs );
+ } else {
+ $msg = reset( $msgs );
+ }
+ $this->getMain()->addWarning( $msg, 'deprecation-help' );
}
/**
$result->addContentValue(
$path,
'docref',
- $this->msg( 'api-usage-docref', $link )->inLanguage( $formatter->getLanguage() )->text()
+ trim(
+ $this->msg( 'api-usage-docref', $link )->inLanguage( $formatter->getLanguage() )->text()
+ . ' '
+ . $this->msg( 'api-usage-mailinglist-ref' )->inLanguage( $formatter->getLanguage() )->text()
+ )
);
} else {
if ( $config->get( 'ShowExceptionDetails' ) ) {
"api-feed-error-title": "Error ($1)",
"api-usage-docref": "See $1 for API usage.",
+ "api-usage-mailinglist-ref": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.",
"api-exception-trace": "$1 at $2($3)\n$4",
"api-credits-header": "Credits",
"api-credits": "API developers:\n* Yuri Astrakhan (creator, lead developer Sep 2006–Sep 2007)\n* Roan Kattouw (lead developer Sep 2007–2009)\n* Victor Vasiliev\n* Bryan Tong Minh\n* Sam Reed\n* Brad Jorsch (lead developer 2013–present)\n\nPlease send your comments, suggestions and questions to mediawiki-api@lists.wikimedia.org\nor file a bug report at https://phabricator.wikimedia.org/."
"apiwarn-wgDebugAPI": "{{doc-apierror}}",
"api-feed-error-title": "Used as a feed item title when an error occurs in <kbd>action=feedwatchlist</kbd>.\n\nParameters:\n* $1 - API error code\n{{Identical|Error}}",
"api-usage-docref": "\n\nParameters:\n* $1 - URL of the API auto-generated documentation.",
+ "api-usage-mailinglist-ref": "{{doc-apierror}} Also used in the error response.",
"api-exception-trace": "\n\nParameters:\n* $1 - Exception class.\n* $2 - File from which the exception was thrown.\n* $3 - Line number from which the exception was thrown.\n* $4 - Exception backtrace.",
"api-credits-header": "Header for the API credits section in the API help output\n{{Identical|Credit}}",
"api-credits": "API credits text, displayed in the API help output"
[ 'code' => 'existing-error', 'text' => 'existing error', 'module' => 'main' ],
[ 'code' => 'ue', 'text' => "Usage exception!", 'data' => [ 'foo' => 'bar' ] ]
],
- 'docref' => "See $doclink for API usage.",
+ 'docref' => "See $doclink for API usage. Subscribe to the mediawiki-api-announce mailing " .
+ "list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> " .
+ "for notice of API deprecations and breaking changes.",
'servedby' => wfHostname(),
]
],
[ 'code' => 'sv-error1', 'text' => 'An error', 'module' => 'foo+bar' ],
[ 'code' => 'sv-error2', 'text' => 'Another error', 'module' => 'foo+bar' ],
],
- 'docref' => "See $doclink for API usage.",
+ 'docref' => "See $doclink for API usage. Subscribe to the mediawiki-api-announce mailing " .
+ "list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> " .
+ "for notice of API deprecations and breaking changes.",
'servedby' => wfHostname(),
]
],