[wp-trac] [WordPress Trac] #38138: Crop media - NaN error at specific &image-editor URL
WordPress Trac
noreply at wordpress.org
Wed Dec 21 14:37:20 UTC 2016
#38138: Crop media - NaN error at specific &image-editor URL
-------------------------------------------------+-------------------------
Reporter: NoseGraze | Owner:
Type: defect (bug) | adamsilverstein
Priority: normal | Status: assigned
Component: Media | Milestone: Awaiting
Severity: major | Review
Keywords: has-patch needs-testing reporter- | Version: 4.6.1
feedback | Resolution:
| Focuses: javascript
-------------------------------------------------+-------------------------
Changes (by adamsilverstein):
* keywords: needs-patch => has-patch needs-testing reporter-feedback
Comment:
@NoseGraze thanks for the details. I tracked this down to a failure to
properly initialize the editor JavaScript code, can you try my patch to
see if that fixes your issue?
In [attachment:38138.diff]:
Ensure the media edit has run `init` when directly loading the media edit
screen.
When the media edit screen is loaded directly via a url such as `/wp-
admin/post.php?post={post_id}&action=edit&image-editor` the JavaScript
fails to execute the `init` function, breaking certain featured that
require setup including cropping. Adds a check in `imgLoaded` that
explicitly checks for the `hold.sizer` required for the cropper. Calls
`init` explicitly if this is undefined.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38138#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list