It turns out that 'resources/lib/oojs-ui/themes/mediawiki/Moved since v0.20.1, use from the 'interactions' pack instead.'
is not usually an existing file, and doesn't have the extension '.svg'.
Not sure why this didn't break earlier.
Bonus: Add module name to exceptions to make these errors easier
to track down.
Bonus #2: Use the post-expansion, not pre-expansion, definition everywhere
to avoid confusion when debugging.
Change-Id: I0325d4dab5658fd29c3c33fd3e762834b53d1b5d
+ // Remove 'deprecated' key
+ if ( is_array( $this->descriptor ) ) {
+ unset( $this->descriptor[ 'deprecated' ] );
+ }
// Ensure that all files have common extension.
$extensions = [];
// Ensure that all files have common extension.
$extensions = [];
- $descriptor = (array)$descriptor;
+ $descriptor = (array)$this->descriptor;
array_walk_recursive( $descriptor, function ( $path ) use ( &$extensions ) {
$extensions[] = pathinfo( $path, PATHINFO_EXTENSION );
} );
$extensions = array_unique( $extensions );
if ( count( $extensions ) !== 1 ) {
throw new InvalidArgumentException(
array_walk_recursive( $descriptor, function ( $path ) use ( &$extensions ) {
$extensions[] = pathinfo( $path, PATHINFO_EXTENSION );
} );
$extensions = array_unique( $extensions );
if ( count( $extensions ) !== 1 ) {
throw new InvalidArgumentException(
- "File type for different image files of '$name' not the same"
+ "File type for different image files of '$name' not the same in module '$module'"
);
}
$ext = $extensions[0];
if ( !isset( self::$fileTypes[$ext] ) ) {
throw new InvalidArgumentException(
);
}
$ext = $extensions[0];
if ( !isset( self::$fileTypes[$ext] ) ) {
throw new InvalidArgumentException(
- "Invalid file type for image files of '$name' (valid: svg, png, gif, jpg)"
+ "Invalid file type for image files of '$name' (valid: svg, png, gif, jpg) in module '$module'"
);
}
$this->extension = $ext;
);
}
$this->extension = $ext;