Page MenuHomePhabricator

Non-latin URL fragments don't reliably get scrolled to
Closed, ResolvedPublic

Description

In T213120 it came up that non-latin fragments are (at least sometimes?) not scrolled to, in the specific case where after editing a section EditorOverlayBase.onSaveComplete updates window.location.hash and then calls window.location.reload()

e.g. https://bn.m.wikipedia.org/wiki/ব্যবহারকারী:RYasmeen_(WMF)/খেলাঘর#শিরোনাma won't scroll to the section.

However, https://bn.m.wikipedia.org/wiki/ব্যবহারকারী:RYasmeen_(WMF)/খেলাঘর#uhdhdhd will.

Event Timeline

I think this is partially Toggler.prototype.reveal passing the urlencoded selector into jquery, which predictably throws, because $( '#%E0%A6%B6%E0%A6%BF%E0%A6%B0%E0%A7%8B%E0%A6%A8%E0%A6%BEma' ) is quite invalid.

Line is:

$target = $container.find( escapeHash( selector ) );

A plausible fix would be:

$target = $container.find( escapeHash( decodeURIComponent( selector ) ) );

...though there may be edge cases there.

Change 503007 had a related patch set uploaded (by DLynch; owner: DLynch):
[mediawiki/extensions/MobileFrontend@master] Toggler: decode hash when checking

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

Change 503007 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Toggler: decode hash when checking

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

@Ryasmeen When this makes its way to bn.wikipedia we'll know how much it has helped your specific case. :D

Jdlrobson subscribed.

Looks like this is being managed as part of editing team workflow so adding VisualEditor tag (cc @JTannerWMF in case that's wrong).

Hey @Jdlrobson you are correct we are going to work on this.

Yeah, I filed it here because it seemed to affect MobileFrontend generally, and just happened to be coming up in response to a redirect section-editing triggered.

@DLynch: Just wanted to be sure, is it on bn.wiki yet?

@Ryasmeen Shouldn't be yet, I don't think. I believe it merged after the deploys started last week, and this week's the RelEng offsite so there's no train... so next week, I guess?

@Ryasmeen Shouldn't be yet, I don't think. I believe it merged after the deploys started last week, and this week's the RelEng offsite so there's no train... so next week, I guess?

Gotcha! Thanks for clarifying that, will check it next week then. Not sure why ReleaseTaggerBot didn't tag it against any release version.