lkucharczyk/mediawiki-PortableInfobox

Use of BeforeParserrenderImageGallery hook... was deprecated in MediaWiki 1.35.

Opened this issue · 1 comments

The release notes indicate there is no replacement, so I'm not certain what needs to be do fix. Though, a vague recommendation is made that "MediaHandler provides for customizable media rendering", which may or may not prove useful here.

I would need another way to grab image data from gallery strip markers then.

public static function getGalleryData( $marker ) {
$gallery = PortableInfoboxDataBag::getInstance()->getGallery( $marker );
return isset( $gallery ) ? array_map( function ( $image ) {
return [
'label' => $image[1],
'title' => $image[0]
];
}, $gallery->getimages() ) : [];
}

I guess I could scrape parsed HTML, just like in tabber (same file; method below), but I would prefer a more elegant approach, so I leave that as a last resort.