Opened 12 years ago
Closed 12 years ago
#22155 closed defect (bug) (fixed)
Images disappear when autosave fires in distraction free mode
Reported by: | johnbillion | Owned by: | koopersmith |
---|---|---|---|
Milestone: | 3.5 | Priority: | low |
Severity: | blocker | Version: | 3.5 |
Component: | Editor | Keywords: | has-patch needs-testing dev-feedback |
Focuses: | Cc: |
Description
Reporting this to see if anyone else can reproduce. Images inserted into posts disappear when autosave kicks in in distraction free writing mode. The images aren't removed, they just disappear visually. Switching out of distraction free writing mode and the images re-appear.
I'm on r22166, Chrome 22 on Win7.
Attachments (2)
Change History (13)
#3
@
12 years ago
- Keywords has-patch needs-testing added
I've made a patch for this problem. The script was getting RAW data from the TinyMCE and putting RAW data into the editor. I changed this to HTML and it looks like it works perfectly.
#6
@
12 years ago
When wp.mce.view.render()
is triggered by the onSetContent
event the view wrappers in the standard editor have the same IDs as those in the fullscreen editor (they were just copied over). This means that the view instance used is the same one being used in the fullscreen editor and so when its el
is detached and appended to the wrapper in the standard editor it is removed from view.
Switching to the HTML format works because wp.mce.view.toViews()
will create new view instances (since the view patterns now match the content being set) which will be used by render()
. However, are there any issues concerning ballooning the number of views? For example, I know that each autosave would trigger another get-attachment
ajax request for each attachment.
A related issue is seen when closing DFW: all images and galleries can be seen to disappear before the rest of the fullscreen editor fades out. See wpFullScreenSave
in wpfullscreen/editor_plugin_src.js
.
#7
@
12 years ago
22155.diff uses the defaults for getContent()/setContent() (which is 'html') and only performs get-attachment AJAX requests when necessary.
Review from koop is required to check:
- That _.defer() is the best thing to do
- That garbage collection of view instances is happening
#9
@
12 years ago
Removing views, see #21813 (comment 30), should resolve this for 3.5.
Fix for 22155