Page MenuHomePhabricator

Back out pending nodes/etc. on switching editor so that e.g. half-made references aren't created
Closed, ResolvedPublic8 Story Points

Description

Steps to reproduce:

  1. Open a page in the visual editor.
  2. Click "Cite".
  3. Click the switch-to-wikitext button.
  4. Save changes
  5. See <ref /> in the wikitext.

Event Timeline

Whatamidoing-WMF raised the priority of this task from to Needs Triage.
Whatamidoing-WMF updated the task description. (Show Details)
Whatamidoing-WMF added a subscriber: Whatamidoing-WMF.
Restricted Application added a project: VisualEditor. · View Herald TranscriptFeb 2 2016, 2:16 AM
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript
Jdforrester-WMF renamed this task from Do not insert blank <ref>s to Back out pending nodes/etc. on switching editor so that e.g. half-made references aren't created.Feb 2 2016, 7:47 PM
Jdforrester-WMF triaged this task as Low priority.
Jdforrester-WMF edited projects, added VisualEditor-MediaWiki; removed Parsoid.
Jdforrester-WMF set Security to None.
Jdforrester-WMF edited a custom field.
Jdforrester-WMF moved this task from To Triage to TR1: Releases on the VisualEditor board.

you mean Keep changes?

Krenair claimed this task.EditedFeb 2 2016, 11:24 PM
Krenair added a subscriber: Esanders.

@Esanders: I looked at this, and was tempted to try a this.getSurface().getModel().popAllStaging call before this.serialize in DesktopArticleTarget#switchToWikitextEditor - but then I looked into how the save dialog is opened... Would this be the right change to make? (in the editSource function)

-       this.getSurface().getDialogs().openWindow( 'wikitextswitchconfirm', { target: this } );
+       var windowAction = ve.ui.actionFactory.create( 'window', this.getSurface() );
+       windowAction.open( 'wikitextswitchconfirm', { target: this } );

Change 268857 had a related patch set uploaded (by Alex Monk):
DesktopArticleTarget#editSource: Use actionFactory to create a window with the surface

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

Change 268857 merged by jenkins-bot:
DesktopArticleTarget#editSource: Use actionFactory to create a window with the surface

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

Krenair closed this task as Resolved.Feb 7 2016, 1:41 PM