Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#31547 closed defect (bug) (duplicate)

Drag and drop feature in the editor not working correctly.

Reported by: msaggiorato's profile msaggiorato Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.1.1
Component: TinyMCE Keywords:
Focuses: javascript, administration Cc:

Description

I've just run into this issue, and after some research i found out that the drag and drop feature opens the media view to append it's results to the "content" editor. which may or may not be available.

I've fixed this locally by doing some duck punching on the wp.media.editor.open function and checking if the targeted id actually exists in among the tinymce editors.

But this could be all avoided if in this file

https://core.trac.wordpress.org/browser/trunk/src/wp-includes/js/media/views.js#L8042

You just check if there's already an active editor, and if not, then default to "content".

Here's the code i used to fix this in my install, but i would love if this gets fixed in some future release.

var oldMediaEditorOpen = wp.media.editor.open;
wp.media.editor.open = function(id, options){
	if(typeof tinymce.editors[id] === "undefined"){
		if(typeof tinyMCE.activeEditor.id !== "undefined")
			id = tinyMCE.activeEditor.id
	}
	return oldMediaEditorOpen.apply(this, [id, options]);
}

Change History (3)

#1 @DrewAPicture
11 years ago

  • Component changed from Upload to TinyMCE

#2 @rommelxcastro
11 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #32527.

thi has been already fixed on [32894]

#3 @iseulde
11 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.