Opened 2 years ago

Closed 2 years ago

#17501 closed defect (bug) (fixed)

Javascript errors in press this

Reported by: greuben Owned by: azaozz
Priority: normal Milestone: 3.2
Component: Press This Version:
Severity: major Keywords: has-patch needs-testing
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 2 years ago.
17501.2.diff (620 bytes) - added by greuben 2 years ago.

Download all attachments as: .zip

Change History (8)

greuben2 years ago

  • Milestone changed from Awaiting Review to 3.2

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.

greuben2 years ago

comment:3 follow-up: ↓ 5   greuben2 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

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

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

comment:5 in reply to: ↑ 3   azaozz2 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.

  • 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.