Opened 12 years ago
Closed 12 years ago
#22123 closed defect (bug) (fixed)
Issue with image turning into spinner graphic
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.5 | Priority: | low |
Severity: | major | Version: | 3.5 |
Component: | Media | Keywords: | |
Focuses: | Cc: |
Description
I've picked up an issue with images being replaced when switching between TinyMCE and Text editor. Here are the steps:
- Insert html into text editor. e.g.
<img class="alignnone size-full wp-image-21710" src="http://en.support.files.wordpress.com/2009/02/appearance_menu1.png" alt="" width="154" height="231" />
- Switch to visual editor. Image isn't displayed - get spinner graphic instead.
- switch back to text editor and html src, width and height is replaced with "undefined" e.g.
<img class="alignnone size-full wp-image-21710" src="undefined" width="undefined" height="undefined" alt />
Whenever I remove "wp-image-21710" the image displays properly.
Change History (6)
#3
@
12 years ago
- Priority changed from normal to high
- Severity changed from normal to major
Some backstory: That content came from en.support.wordpress.com, which was imported into make.wordpress.org/support as starter content.
The attachment 21710 doesn't exist on the new site, but the post does indeed have that class in there. Attachments were not copied over in this case. Even if they were, while we would attempt to rewrite the URLs to make them local, there's no guarantee the ID would match, as it may already be used.
So, this is a pretty big problem. Perhaps we could make the importer map attachment ID classes as a nice enhancement. But the important part is we need to add some sanity checking to ensure this doesn't break. We will probably need to make sure that the URL matches the attachment data found via the ID before considering it an attachment we can turn into a view.
#4
@
12 years ago
I think the problem is when using a image form external location
#5
@
12 years ago
- Priority changed from high to low
Removing views, see #21813 (comment 30), should resolve this for 3.5.
By adding in "wp-image-21710" I think you're telling WP that this is an existing media attachment with the ID of 21710. When you switch to the visual editor, it's (unsuccessfully) trying to look up that attachment.
I think the solution, as you mentioned is to simply leave "wp-image-21710" out when the image you're adding isn't actually associated with attachment 21710.
I may be missing something else here...?