$result->addIndexedTagName( [ 'query', $this->getModuleName() ], $modulePrefix );
}
// @todo Update exception handling here to understand current getFile exceptions
- // @todo Internationalize the exceptions
} catch ( UploadStashFileNotFoundException $e ) {
- $this->dieWithError( [ 'apierror-stashedfilenotfound', wfEscapeWikiText( $e->getMessage() ) ] );
+ $this->dieWithException( $e, [ 'wrap' => 'apierror-stashedfilenotfound' ] );
} catch ( UploadStashBadPathException $e ) {
- $this->dieWithError( [ 'apierror-stashpathinvalid', wfEscapeWikiText( $e->getMessage() ) ] );
+ $this->dieWithException( $e, [ 'wrap' => 'apierror-stashpathinvalid' ] );
}
}
- private $propertyFilter = [
+ private static $propertyFilter = [
'user', 'userid', 'comment', 'parsedcomment',
'mediatype', 'archivename', 'uploadwarning',
];
+ /**
+ * Returns all possible parameters to siiprop
+ *
+ * @param array|null $filter List of properties to filter out
+ * @return array
+ */
+ public static function getPropertyNames( $filter = null ) {
+ if ( $filter === null ) {
+ $filter = self::$propertyFilter;
+ }
+ return parent::getPropertyNames( $filter );
+ }
+
+ /**
+ * Returns messages for all possible parameters to siiprop
+ *
+ * @param array|null $filter List of properties to filter out
+ * @return array
+ */
+ public static function getPropertyMessages( $filter = null ) {
+ if ( $filter === null ) {
+ $filter = self::$propertyFilter;
+ }
+ return parent::getPropertyMessages( $filter );
+ }
+
public function getAllowedParams() {
return [
'filekey' => [
'prop' => [
ApiBase::PARAM_ISMULTI => true,
ApiBase::PARAM_DFLT => 'timestamp|url',
- ApiBase::PARAM_TYPE => self::getPropertyNames( $this->propertyFilter ),
+ ApiBase::PARAM_TYPE => self::getPropertyNames(),
ApiBase::PARAM_HELP_MSG => 'apihelp-query+imageinfo-param-prop',
- ApiBase::PARAM_HELP_MSG_PER_VALUE => self::getPropertyMessages( $this->propertyFilter )
+ ApiBase::PARAM_HELP_MSG_PER_VALUE => self::getPropertyMessages()
],
'urlwidth' => [
ApiBase::PARAM_TYPE => 'integer',
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Stashimageinfo';
+ return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Stashimageinfo';
}
}