#32527 closed defect (bug) (fixed)
"Press This" TypeError on drop images
Reported by: | sebastiantiede | Owned by: | azaozz |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 4.2 |
Component: | Media | Keywords: | has-patch |
Focuses: | javascript, administration | Cc: |
Description
"Press This" bookmarklet — Clean WP 4.2.2
An error occurred on image drop after upload while insertion to the editor via media popup (see the error below).
no error:
- I drop the image -> unselect and select the dropped image -> insert
- Open media popup -> select any image -> insert
TypeError: document.getElementById(...) is null http://l/_playgrounds/wordpress/wp-admin/load-scripts.php?c=1&load%5B%5D=hoverIntent,common,underscore,shortcode,backbone,wp-util,wp-backbone,media-models,wp-plupload,jquery-ui-core,jquery-ui-widget,jq&load%5B%5D=uery-ui-mouse,jquery-ui-sortable,mediaelement,wp-mediaelement,media-views,media-editor,media-audiovideo,wp-playlist,mce-view,img&load%5B%5D=areaselect,image-edit,suggest,tags-box,press-this,editor,word-count,wplink&ver=4.2.2 Line 127
Attachments (3)
Change History (18)
#3
@
9 years ago
- Keywords reporter-feedback added
Can't reproduce either. Could you clear browser cache (always a good thing while debugging), then enable SCRIPT_DEBUG
to see exactly where that error comes from.
#4
@
9 years ago
After clearing browser cache and enabling
SCRIPT_DEBUG
the error is:
TypeError: document.getElementById(...) is null /wp-includes/js/media-editor.js?ver=4.2.2 Line 793
#5
@
9 years ago
- Keywords reporter-feedback removed
thank you @sebastiantiede, i'll start working on a patch for this
#6
@
9 years ago
- Keywords reporter-feedback added
hey @sebastiantiede, i'm still unable to reproduce this, tested on macosx with chrome and firefox
4.3-alpha-32828 and 4.2.2
#7
@
9 years ago
This implies that the wpActiveEditor
JS "global" is not set. For PT that should always be set to pressthis
(the editor id).
It may have something to do with the "Add Media" button (lower/left corner), as it has nested span element that actually receives the clicks. However haven't been able to reproduce in any current browser, tested in Chrome, Firefox and IE11.
#8
@
9 years ago
The error occurs in Firefox 38.0.5 and Chrome 43.0.2357.124 on MacOSX.
I attached a short Screencast with the move that triggers the error.
#9
@
9 years ago
- Keywords has-patch needs-testing 2nd-opinion added; needs-patch reporter-feedback removed
hey guys, here's a patch for this, tested on other editors and seems like i didn't broke anything but if someone else can help testing that would be great! thanks
#10
@
9 years ago
Nice catch! When opening the modal, that id has to be either empty or wpActiveEditor.
Was finally able to reproduce the error too, have to open PT and drop a file for uploading straight away, without clicking anywhere, etc.
#11
@
9 years ago
- Component changed from Press This to Media
- Keywords needs-testing 2nd-opinion removed
- Milestone changed from Awaiting Review to 4.3
i tried to reproduce this on version 4.3-alpha-32828 and was unable to reproduce it