Make WordPress Core

Opened 9 years ago

Closed 7 years ago

#29216 closed defect (bug) (fixed)

Cannot read previousSibling of null when inserting wp-view.

Reported by: programmin's profile programmin Owned by:
Milestone: 4.6 Priority: normal
Severity: normal Version: 3.9
Component: TinyMCE Keywords:
Focuses: ui, javascript Cc:


Steps to find the bug (WP 4.0 beta3):

1) Start a post with this in text editor:


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 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 load-scripts.php?c=1&load%5B%5D=hoverIntent,common,admin-bar,schedule,wp-ajax-response,autosave,sug…:602 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)

Screen Shot 2015-04-24 at 12.41.46.png (46.9 KB) - added by iseulde 8 years ago.

Download all attachments as: .zip

Change History (10)

#1 @ocean90
9 years ago

  • Keywords needs-patch added
  • Version changed from trunk to 3.9

Confirmed, but could reproduce it in 3.9 too.


Uncaught TypeError: Cannot read property 'previousSibling' of null tinymce.js?ver=4103-20140809:19843
addCommands.mceInsertContent tinymce.js?ver=4103-20140809:19843
execCommand tinymce.js?ver=4103-20140809:19391
Editor.execCommand tinymce.js?ver=4103-20140809:29430
send_to_editor media-upload.js?ver=4.0-beta4-src:23 media-editor.js?ver=4.0-beta4-src:769
(anonymous function) media-editor.js?ver=4.0-beta4-src:849
triggerEvents backbone.js?ver=1.1.2:207
Backbone.Events.trigger backbone.js?ver=1.1.2:148 media-views.js?ver=4.0-beta4-src:2799 media-views.js?ver=4.0-beta4-src:4273
m.event.dispatch jquery.js?ver=1.11.1:3
r.handle jquery.js?ver=1.11.1:3

This ticket was mentioned in IRC in #wordpress-dev by sathishn1. View the logs.

9 years ago

#3 @iseulde
9 years ago

  • Component changed from Editor to TinyMCE

#4 @bfintal
8 years ago

Still exists in 4.1.2

#5 @bfintal
8 years ago

  • Keywords needs-testing added; needs-patch removed

I've been testing with trunk and the issue seems to be gone

Last edited 8 years ago by bfintal (previous) (diff)

#6 @iseulde
8 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.

This ticket was mentioned in Slack in #core-editor by iseulde. View the logs.

7 years ago

#8 @iseulde
7 years ago

  • Keywords needs-testing removed
  • Milestone changed from Awaiting Review to 4.6

This seems now entirely resolved after [36434].

#9 @iseulde
7 years ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.