Page MenuHomePhabricator

VisualEditor sometimes enters edit mode on protected pages
Closed, DuplicatePublic

Description

Go to the link https://en.wikipedia.org/wiki/User:BethNaught?veaction=edit when logged out or when logged in to a non-admin account. VisualEditor will allow you to edit and the save button is enabled. However after entering the edit summary (or not) an error is thrown because the page is protected. This problem occurs when editing protected pages and when attempting to create pages logged out.

OK, so if a page is protected then no link is displayed to reach edit mode, so this isn't a problem, right? However, there is the possibility of confusion. A newbie could (for example) go to https://en.wikipedia.org/wiki/User:BethNaught and click View Source. The "new user welcome editor choice dialog" or whatever it's called appears. Now switch to VE by pressing the button on the dialog. VE opens in edit mode. Moreover the warnings flyout, which contains the protection message, is overridden by the "you have switched to VE" flyout and not displayed after that has been closed.

To fix this, I would suggest either not showing the "new user welcome editor choice dialog" when the user does not have enough rights to edit the page, or to disable VE edit mode/disable the save button therein on such pages.