Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#17501 closed defect (bug) (fixed)

Javascript errors in press this

Reported by: greuben's profile greuben Owned by: azaozz's profile azaozz
Milestone: 3.2 Priority: normal
Severity: major Version:
Component: Press This Keywords: has-patch needs-testing
Focuses: Cc:

Description

On press this click embed video, insert some code and click insert video. An error is thrown in Chrome and the box does not close

Uncaught Error: HIERARCHY_REQUEST_ERR: DOM Exception 3

Attachments (2)

17501.diff (598 bytes) - added by greuben 13 years ago.
17501.2.diff (620 bytes) - added by greuben 13 years ago.

Download all attachments as: .zip

Change History (8)

@greuben
13 years ago

#1 @nacin
13 years ago

  • Milestone changed from Awaiting Review to 3.2

#2 @azaozz
13 years ago

The first arg. for execInstanceCommand() should be the editor ID which is the same as the ID of the textarea that was replaced (content), so the proposed patch seems to be disabling the cleanup.

@greuben
13 years ago

#3 follow-up: @greuben
13 years ago

Seems like mceCleanup needs selection

Backtrace

Uncaught Error: HIERARCHY_REQUEST_ERR: DOM Exception 3
c.create.getBookmark -- tiny_mce.js:1
c.EditorCommands.t.mceCleanup -- tiny_mce.js:1
q -- tiny_mce.js:1
m.create.execCommand -- tiny_mce.js:1
j.EditorManager.d.execCommand -- tiny_mce.js:1
append_editor -- press-this.php:161
(anonymous function):4
f.event.handle -- jquery.js:17
f.event.add.k.i.handle.k -- jquery.js:16

Code

mceCleanup : function() {
	var bookmark = selection.getBookmark(); // the errors occurs here
	editor.setContent(editor.getContent({cleanup : TRUE}), {cleanup : TRUE});
	selection.moveToBookmark(bookmark);
},

@azaozz: can you confirm if the latest patch is working? see 17501.2.diff

#4 @westi
13 years ago

  • Keywords needs-testing added
  • Owner set to azaozz
  • Status changed from new to reviewing

Assigning to azaozz for review, testing and commit/!commit call.

#5 in reply to: ↑ 3 @azaozz
13 years ago

Replying to greuben:

Seems like mceCleanup needs selection
...
@azaozz: can you confirm if the latest patch is working? see 17501.2.diff

Yes, seems to be working. I dug a bit deeper and think we can skip the forced mceCleanup completely. That seems to happen automatically in this version of TinyMCE. Please reopen if there are still issues when adding videos or images in Press This.

#6 @azaozz
13 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In [18155]:

Fix JS error in Press This, props greuben, fixes #17501

Note: See TracTickets for help on using tickets.