Page MenuHomePhabricator

Back button doesn't close MediaViewer if the URL has a fragment with "/"
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
Nothing

What should have happened instead?:
The image should close

Other information (browser name/version, screenshots, etc.):
Chrome

Details
This happens precisely when there is "/" in the URL fragment and doesn't happen otherwise. Probably MediaViewer confuses "/" with its own fragment (like /media/File:Open_Access_logo_PLoS_transparent.svg).

Event Timeline

Izno renamed this task from Back button doesn't close MediaViewer is the URL had a fragment with "/" to Back button doesn't close MediaViewer if the URL has a fragment with "/".Apr 3 2024, 4:50 AM
Jdlrobson subscribed.

MediaViewer should be listening to router.on( 'route', (https://doc.wikimedia.org/mediawiki-core/master/js/OO.Router.html#.event:route) and closing itself when the hash is something that doesn't refer to itself.

Jdlrobson triaged this task as Medium priority.May 14 2024, 3:53 PM
Jdlrobson moved this task from Backlog to Triaged on the MediaViewer board.

Change #1079649 had a related patch set uploaded (by Simon04; author: Simon04):

[mediawiki/extensions/MultimediaViewer@master] Back button doesn't close MediaViewer if the URL has a fragment with "/"

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

Change #1079649 merged by jenkins-bot:

[mediawiki/extensions/MultimediaViewer@master] Back button doesn't close MediaViewer if the URL has a fragment with "/"

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

Jdlrobson claimed this task.

The patch above changes the route to /.*$/. While this works, such a generic path registration would conflict with any other app that tried to use the same approach.

MediaViewer should be listening to router.on( 'route', (https://doc.wikimedia.org/mediawiki-core/master/js/OO.Router.html#.event:route) and closing itself when the hash is something that doesn't refer to itself.

This is the better way to do it, as multiple apps can listen to the route event without conflicting.

Change #1080061 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/MultimediaViewer@master] Routing: Don't register a path for closing MMV

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

Change #1080061 merged by jenkins-bot:

[mediawiki/extensions/MultimediaViewer@master] Routing: Don't register a path for closing MMV

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