Page MenuHomePhabricator

vehidebetadialog doesn't work for page views, gets erased when user clicks edit
Open, Needs TriagePublic


If you clear your visualeditor-hidebetawelcome preference(*), then go to /wiki/Foo?action=edit&vehidebetadialog=1, VE opens without the welcome dialog (this is correct).

However, if you then clear the preference again(**) and go to /wiki/Foo?vehidebetadialog=1, then click the "Edit" button, VE opens and displays the welcome dialog. This is unexpected. It looks like this is happening because the URL is first changed to /wiki/Foo?action=edit, and only then does the code checking for the vehidebetadialog parameter run.

(*) By running new mw.Api().saveOption('visualeditor-hidebetawelcome', 0).done( () => location.reload() ) in the browser console
(**) The welcome dialog is never shown again even if it was suppressed by the URL parameter, not sure if this is intended

Event Timeline

Catrope created this task.Apr 10 2020, 9:40 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 10 2020, 9:40 PM

This only breaks in single edit tab mode. When there are two edit tabs, the logic for building the new URL is different and extends the existing URL. When there is only one edit tab, it constructs a new URL instead for some reason. See this code, where uri is the current URL and viewUri = new mw.Uri( mw.util.getUrl( wgRelevantPageName ) )

This behavior (of always using viewUri in SET mode) was added in rEVED748db015b041: Single edit tab and section links without a real explanation in the commit message.

Change 588048 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/VisualEditor@master] DesktopArticleTarget.init: Also extend existing URL in SET mode

Catrope claimed this task.Apr 10 2020, 11:39 PM

Change 588048 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] DesktopArticleTarget.init: Also extend existing URL in SET mode