Move the added module from Parser.php to TraditionalImageGallery,
because there the gallerybox class is added to the html and at the
moment all core image galleries are extending the traditional one.
That brings the styles back for special pages like Special:NewFiles,
Special:MostImages and also on category pages with media files.
Follows Ib1aef04dc4fece78e6615386ecaef6a9f368f49e
Bug: T113511
Change-Id: I32697c2c65824d7622c1840330d6074ebb68b488
array( 'class' => 'gallery mw-gallery-' . $this->mMode ), $this->mAttribs );
$modules = $this->getModules();
+ $modules[] = 'mediawiki.page.gallery.styles';
if ( $this->mParser ) {
$this->mParser->getOutput()->addModules( $modules );
$ig->setParser( $this );
$ig->setHideBadImages();
$ig->setAttributes( Sanitizer::validateTagAttributes( $params, 'table' ) );
- $this->getOutput()->addModuleStyles( 'mediawiki.page.gallery.styles' );
if ( isset( $params['showfilename'] ) ) {
$ig->setShowFilename( true );