Page MenuHomePhabricator

MediaViewer does not work directly after saving a VisualEditor edit
Closed, DuplicatePublic

Description

MediaViewer does not work directly after saving a VisualEditor edit.

Steps to reproduce;

  1. Open a page in VE mode
  2. Make an edit
  3. Save edit
  4. Click on an image

Result: File page is loaded
Expected result: Image is shown by the MediaViewer

Event Timeline

Raymond raised the priority of this task from to Needs Triage.
Raymond updated the task description. (Show Details)
Raymond added projects: MediaViewer, VisualEditor.
Raymond added a subscriber: Raymond.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdforrester-WMF set Security to None.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Presumably caused by VE's all-stop command not being undone.

MediaViewer makes a dictionary of <img> elements on page load (see the constructor and processThumbs() in mmv.bootstrap.js) and cannot handle content added dynamically. (The page parsing logic is crappy anyway and in need of a rewrite - e.g. T77220)

MediaViewer makes a dictionary of <img> elements on page load (see the constructor and processThumbs() in mmv.bootstrap.js) and cannot handle content added dynamically. (The page parsing logic is crappy anyway and in need of a rewrite - e.g. T77220)

Is this considered a bug in MediaViewer then?

More like tech debt.

How would an application normally react to a VE save? Is there a hook, or an event to listen for?

I don't think there is a VE-specific hook... We do fire wikipage.content. I think @Mooeypoo has had a similar problem before?