Page MenuHomePhabricator

gallery slideshow stopped working
Closed, ResolvedPublic

Description

with newest release (1.35.0-wmf.19), it seems that gallery slideshow stopped working when not wrapped in a block element with "max-width", "min-width". or "width" style defined.
before this version, it was enough to have a:

<gallery mode=slideshow>
file | description
....
</gallery>

for gallery to actually show a slideshow. from this version, it seems that it became essential to either add style with set max-width to the gallery tag, or to wrap it inside a div with max-width value, like so:

<gallery mode="slideshow" style="max-width:438px">
file | description
....
</gallery>

or like so

<div style="max-width:438px">
<gallery mode=slideshow>
file | description
....
</gallery>
</div>

otherwise, no slideshow.
this is not documented anywhere, and i find it hard to believe it's the intended behavior.

NOTE: naked gallery slideshow tag _did_work (i.e., displayed a slideshow) with previous version (i think 1.35.0-wmf.18)

verified with chrome ( 79.0.3945.130), firefox (73.0.1) and edge (44.18362.449.0).

peace.

Event Timeline

Aklapper added a project: Regression.

Thanks for reporting this! Confirming on https://www.mediawiki.org/wiki/User:AKlapper_(WMF)/Sandbox#phab:T245553 ; sounds a bit similar to T245098.

No maintainers listed https://www.mediawiki.org/wiki/Developers/Maintainers .
https://phabricator.wikimedia.org/tag/mediawiki-gallery/ says "Maintained by: Multimedia" which is incorrect (see unresolved T240281).

Even with the codes suggested by @Kipod it is not working for me. It shwos the slideshow skeleton and doesn't show most of the images, except for a few, with no consistency (See this page in ptwiki, for example).

zeljkofilipin subscribed.

Should this be blocker for this week's train (T233868), if it's a regression?

Should this be blocker for this week's train (T233868), if it's a regression?

Absolutely not, unless it's a regression in wmf.20. Otherwise you're just wasting everyone's time.

I've created https://en.wikipedia.beta.wmflabs.org/wiki/User:Jdforrester_(WMF)/T245553 to test this.

In Firefox 74 and Chrome 80, all three wrapping modes you suggest seem to work as normal for the first two images but in trying to load the third image it initially loads and then fails back to just the file name. No console error is emitted.

Is this what you meant by it "stopped working"? If not, can you please give detailed expectation/result steps? Thanks.

This fixes the problem for me:
In resources/src/mediawiki.page.gallery.slideshow.js, change line 351 from params.iiurlheight = this.imageHeight; to params.iiurlheight = Math.round(this.imageHeight); and line 353 from params.iiurlwidth = this.imageWidth; to params.iiurlwidth = Math.round(this.imageWidth);.

The cause is a non-integer iiurlwidth parameter.

@Thjarkur: Thanks for taking a look at the code!
You are very welcome to use developer access to submit the proposed code changes as a Git branch directly into Gerrit which makes it easier to review and provide feedback. If you don't want to set up Git/Gerrit, you can also use the Gerrit Patch Uploader. Thanks again!

Change 574208 had a related patch set uploaded (by Gerrit Patch Uploader; owner: Þjarkur):
[mediawiki/core@master] Bug T245553, gallery slideshows no longer worked in 1.35.0 due to a non-integer value being sent to the Image API

https://gerrit.wikimedia.org/r/574208

Change 574208 had a related patch set uploaded (by Jforrester; owner: Þjarkur):
[mediawiki/core@master] GallerySlideshow.setSizeRequirement: Account for unrounded values on width/height

https://gerrit.wikimedia.org/r/574208

Change 574208 merged by jenkins-bot:
[mediawiki/core@master] GallerySlideshow.setSizeRequirement: Account for unrounded values on width/height

https://gerrit.wikimedia.org/r/574208

matmarex assigned this task to Thjarkur.
matmarex subscribed.

Thanks for the patch!

Hey, thanks for the patch. This is now merged and is rolling out with this week's train, so should be fixed in production for Wikipedias late on 2020-02-27 UTC.