Opened 14 years ago
Closed 14 years ago
#21145 closed defect (bug) (fixed)
Switch from HTML to VISUAL mode - does not show anything in Visual mode
| Reported by: | selnomeria | Owned by: | azaozz |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.4.2 |
| Component: | Editor | Version: | 3.4 |
| Severity: | major | Keywords: | |
| Cc: | Focuses: |
Description
why it hasn't been fixed yet?
when i insert a bunch of codes in html mode(for example, many of these codes:
<href... <iframe... and etc..
and switch to VISUAL MODE, and then to HTML again, all of the codes and formatting are lost!
Attachments (2)
Change History (13)
#2
@
14 years ago
- Summary Switch from HTML to VISUAL mode → Switch from HTML to VISUAL mode - does not show anything in Visual mode
#3
in reply to: ↑ 1
@
14 years ago
- Keywords has-patch added
- Milestone Awaiting Review → 3.5
- Version 3.4.1 → 3.4
Version number indicates when the bug was initially introduced/reported.
I could not reproduce the original bug from the description. This content is preserved when switching from Visual to HTML (Text) mode:
<iframe src="http://trunk.wordpress/" width="320" height="240"></iframe>
<href> is not a valid tag, so I've excluded it from the test.
Replying to mati1000:
Uncaught TypeError: Cannot read property '0' of null /wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js?ver=349-20805:1 Char: 2392
The error corresponds to line 145, introduced in [19982]:
http://core.trac.wordpress.org/browser/tags/3.4.1/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js#L144
I can only reproduce this if I manually remove the id attribute from the [caption] shortcode. It should be there by default. If it's not in your case, your theme or some plugin might interfere with captions.
We should probably check if match() was successful though (21145.patch), since the errors due to missing attributes also cause both editors to be rendered at the same time (21145.overlapping.png).
#4
@
14 years ago
The patch looks good. Not sure what would be the best thing to do when the caption shortcode is invalid. Perhaps it should be shown as-is (a text string) instead of being parsed.
#6
@
14 years ago
- Keywords has-patch removed
- Milestone 3.5
- Resolution → invalid
- Status new → closed
Cannot reproduce the originally reported problem either. Since the browser parses the string from the Text editor (the textarea) into a HTML document, invalid/custom tags are only supported if registered in TinyMCE.
Closing as invalid for now, feel free to reopen with a valid example that can be reproduced.
#7
@
14 years ago
- Resolution invalid
- Status closed → reopened
Hi,
Our HTML example is:
[caption align="alignleft" width="500"]<img class="alignleft size-thumbnail wp-image-41536" src="http://core.trac.wordpress.org/raw-attachment/ticket/21145/21145.overlapping.png" alt="" width="500" height="72" /> Ticket #21145: 21145.overlapping.png[/caption]
and SergeyBiryukov is right, because the missing id attribute - the match is failed. In addition, I get both editors that are rendered at the same time - like in the 21145.overlapping.png.
And of course, after define the SCRIPT_DEBUG and applying the patch its works!
I don't know why we don't have the id in the shortcode, but we have a lot of posts with captions without ids, and we cannot now upgrade to the last version.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
We have upgraded to the latest version 3.4.1 and we have the same problem.
Posts that contain [caption] shortcode does not show anything in Visual mode.
with js error: Uncaught TypeError: Cannot read property '0' of null /wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js?ver=349-20805:1 Char: 2392