Opened 10 years ago
Closed 9 years ago
#29216 closed defect (bug) (fixed)
Cannot read previousSibling of null when inserting wp-view.
Reported by: | programmin | Owned by: | |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | TinyMCE | Keywords: | |
Focuses: | ui, javascript | Cc: |
Description
Steps to find the bug (WP 4.0 beta3):
1) Start a post with this in text editor:
<div>hello</div> <div>goodbye</div>
2) With cursor at the start of the second line ("goodbye"), Go to add media, and insert a gallery or audio playlist.
3) Notice that an exception is thrown:
Uncaught TypeError: Cannot read property 'previousSibling' of null wp-tinymce.php?c=1&ver=4102-20140721:8 C.mceInsertContent wp-tinymce.php?c=1&ver=4102-20140721:8 v wp-tinymce.php?c=1&ver=4102-20140721:7 N.execCommand wp-tinymce.php?c=1&ver=4102-20140721:10 send_to_editor load-scripts.php?c=1&load%5B%5D=hoverIntent,common,admin-bar,schedule,wp-ajax-response,autosave,sug…:1031 wp.media.editor.insert load-scripts.php?c=1&load%5B%5D=hoverIntent,common,admin-bar,schedule,wp-ajax-response,autosave,sug…:604 (anonymous function) load-scripts.php?c=1&load%5B%5D=hoverIntent,common,admin-bar,schedule,wp-ajax-response,autosave,sug…:604 k load-scripts.php?c=1&load%5B%5D=hoverIntent,common,admin-bar,schedule,wp-ajax-response,autosave,sug…:384 b.Events.trigger load-scripts.php?c=1&load%5B%5D=hoverIntent,common,admin-bar,schedule,wp-ajax-response,autosave,sug…:384 toolbar.set.d.view.Toolbar.items.insert.click load-scripts.php?c=1&load%5B%5D=hoverIntent,common,admin-bar,schedule,wp-ajax-response,autosave,sug…:602 d.view.Button.d.View.extend.click load-scripts.php?c=1&load%5B%5D=hoverIntent,common,admin-bar,schedule,wp-ajax-response,autosave,sug…:602 m.event.dispatch load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,plupload,json2&ver=4.0-beta3:3 r.handle load-scripts.php?c=1&load%5B%5D=jquery-core,jquery-migrate,utils,plupload,json2&ver=4.0-beta3:3
Oddly enough the wp-view seems to work normally immediately after, but there was major breakage when using editor in Tinymce-inline mode after this exception.
Attachments (1)
Change History (10)
This ticket was mentioned in IRC in #wordpress-dev by sathishn1. View the logs.
10 years ago
#5
@
10 years ago
- Keywords needs-testing added; needs-patch removed
I've been testing with trunk and the issue seems to be gone
#6
@
10 years ago
The error seems to be gone. However, inserting a view in a div is still very buggy. They're not made for it. See screenshot.
Confirmed, but could reproduce it in 3.9 too.
Stack: