sewpafly / post-thumbnail-editor

Wordpress Plugin to manually edit post thumbnails
http://wordpress.org/extend/plugins/post-thumbnail-editor/
32 stars 18 forks source link

JS Error with WP 4.1 #110

Closed jambox closed 9 years ago

jambox commented 9 years ago

Hey there. I've used this plugin on a ton of sites and it's indispensible...thanks!

However...I just upgraded to WP 4.1 and it seems theres a series of fatal JS errors on the page (both standard and iframe) so nothing loads.

I was seeing this behavior on a WP install I'm currently developing a theme on and thought it might be a plugin/theme conflict or something so I did a fresh 4.1 install and it seems to work. But I'm confused b/c on the install I'm developing with, I've tried disabling all plugins except PTE, saving the permalinks again, changing to twentyfifteen and twentyfourteen and for some reason it still fails. The first error in the JS console is:

Uncaught TypeError: undefined is not a functionload-scripts.php?c=1&load[]=jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-resizable,jqu…:114 (anonymous function)load-scripts.php?c=1&load[]=jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-resizable,jqu…:114

And then subsequently some require.js errors are triggered: screen shot 2014-12-19 at 5 12 11 pm

I feel like I tried to test what I could and can't figure out whats going on. Myabe a weird version of jQuery is being included or something? I'm gonna roll back to WP 4.0.1 for now, but hopefully you have some insight.

Thanks!

sewpafly commented 9 years ago

If you put PTE in debugging mode you should get some better error messages (Settings → Post Thumbnail Editor).

Maybe a browser caching issue?

I haven't updated to 4.1 yet, so I'm not sure what the changes are if any yet.

jambox commented 9 years ago

Wow lightning fast response! I'd already tried that (if you can't tell, I wanted to resolve this without having to drag you into it) but there was nothing valuable that I could see. Here's the output. Let me know if there are other debugging things I can do to help (maybe activate the plugin in it's non-minified form to find the source of the issue/conflict?):

[DEBUG  ][2014-12-19T22:29:44+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [pte-action] => iframe
    [pte-id] => 55
) ]
[DEBUG  ][2014-12-19T22:29:44+00:00][ PTE-VERSION: 2.4.2
USER-AGENT:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
WORDPRESS:   4.1 ]
[DEBUG  ][2014-12-19T22:34:51+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [pte-action] => iframe
    [pte-id] => 55
) ]
[DEBUG  ][2014-12-19T22:34:51+00:00][ PTE-VERSION: 2.4.2
USER-AGENT:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
WORDPRESS:   4.1 ]
[DEBUG  ][2014-12-19T22:43:37+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [pte-action] => iframe
    [pte-id] => 55
) ]
[DEBUG  ][2014-12-19T22:43:37+00:00][ PTE-VERSION: 2.4.2
USER-AGENT:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:30.0) Gecko/20100101 Firefox/30.0
WORDPRESS:   4.1 ]
[DEBUG  ][2014-12-19T22:44:43+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [pte-action] => iframe
    [pte-id] => 55
) ]
[DEBUG  ][2014-12-19T22:44:43+00:00][ PTE-VERSION: 2.4.2
USER-AGENT:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
WORDPRESS:   4.1 ]
[DEBUG  ][2014-12-19T22:50:58+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [pte-action] => iframe
    [pte-id] => 55
) ]
[DEBUG  ][2014-12-19T22:50:58+00:00][ PTE-VERSION: 2.4.2
USER-AGENT:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
WORDPRESS:   4.0.1 ]
[DEBUG  ][2014-12-19T22:51:00+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [id] => 55
    [pte-action] => get-thumbnail-info
) ]
[WARNING][2014-12-19T22:51:00+00:00][ Couldn't find or generate metadata for image: 55-large ]
[WARNING][2014-12-19T22:51:00+00:00][ Couldn't find or generate metadata for image: 55-slider-image ]
[DEBUG  ][2014-12-19T22:58:58+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [pte-action] => iframe
    [pte-id] => 55
) ]
[DEBUG  ][2014-12-19T22:58:58+00:00][ PTE-VERSION: 2.4.2
USER-AGENT:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
WORDPRESS:   4.1 ]
[DEBUG  ][2014-12-19T22:59:22+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [pte-action] => iframe
    [pte-id] => 54
) ]
[DEBUG  ][2014-12-19T22:59:22+00:00][ PTE-VERSION: 2.4.2
USER-AGENT:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
WORDPRESS:   4.1 ]
[DEBUG  ][2014-12-19T22:59:32+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [pte-action] => iframe
    [pte-id] => 54
) ]
[DEBUG  ][2014-12-19T22:59:32+00:00][ PTE-VERSION: 2.4.2
USER-AGENT:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
WORDPRESS:   4.1 ]
[DEBUG  ][2014-12-19T23:00:05+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [pte-action] => iframe
    [pte-id] => 54
) ]
[DEBUG  ][2014-12-19T23:00:05+00:00][ PTE-VERSION: 2.4.2
USER-AGENT:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
WORDPRESS:   4.1 ]
[DEBUG  ][2014-12-19T23:01:24+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [pte-action] => iframe
    [pte-id] => 54
) ]
[DEBUG  ][2014-12-19T23:01:24+00:00][ PTE-VERSION: 2.4.2
USER-AGENT:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
WORDPRESS:   4.1 ]
[DEBUG  ][2014-12-19T23:02:00+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [pte-action] => iframe
    [pte-id] => 55
) ]
[DEBUG  ][2014-12-19T23:02:00+00:00][ PTE-VERSION: 2.4.2
USER-AGENT:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
WORDPRESS:   4.1 ]
[DEBUG  ][2014-12-19T23:02:16+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [pte-action] => iframe
    [pte-id] => 55
) ]
[DEBUG  ][2014-12-19T23:02:16+00:00][ PTE-VERSION: 2.4.2
USER-AGENT:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
WORDPRESS:   4.1 ]
[DEBUG  ][2014-12-19T23:22:51+00:00][ PARAMETERS: Array
(
    [action] => pte_ajax
    [pte-action] => iframe
    [pte-id] => 54
    [TB_iframe] => true
    [title] => false
) ]
[DEBUG  ][2014-12-19T23:22:51+00:00][ PTE-VERSION: 2.4.2
USER-AGENT:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
WORDPRESS:   4.1 ]
jambox commented 9 years ago

I also tried in a Chrome incognito window and in Firefox. Same results. So I don't think it's related to caching....

sewpafly commented 9 years ago

Debug mode should put the javascript in an "unminified" mode.

The error message that you were seeing looked more like a wordpress error. If you look at the javascript console on any wordpress admin page is that error still there? (If it is, does it go away when you disable PTE?)

Purely from a historical standpoint, the nothing loading error happens when you have a plugin or theme with an extra line after a closing ?>. It might be worthwhile to look for that in a theme's functions.php or some plugin file that might have it.

jambox commented 9 years ago

Hey sorry I'd like to keep helping but somehow my local MySQL just became corrupted and I can't run any LAMP stuff...when it's up and running again I'll try to help you sort this out....

kingstringy commented 9 years ago

Hi. I just installed PTE on a development site and I'm getting the same JS errors jambox got. Debug was already active before I installed PTE, I tried deactivating other plugins and changing themes – no luck.

The page is error-free until the pop-up window appears, and the JS errors disappear when PTE is deactivated. Is there anything else I can check/test to give you more info?

sewpafly commented 9 years ago

@kingstringy - Can you disable WP_DEBUG and make sure that the PTE debug mode is not enabled to see if the problem persists? _(WP_DEBUG overrides the PTE setting for debug)_. Also, when in debug mode, PTE tries to run the coffeescript straight from the browser unminified. I probably need to simplify this code, but finding the time is difficult.

kingstringy commented 9 years ago

No worries. Just disabled WP_DEBUG and PTE's debug, and PTE seems to be working fine now. (I've been running WP 4.1 the whole time, by the way.) If I can assist more, let me know. Thanks for the help and the great plugin.

tfrommen commented 9 years ago

@sewpafly I can also verify that your plugin seems to work fine when not in debug mode. This is not an actual fix, though. ;)

According to Debug Bar and Firebug, I can share the following errors:

Error: Mismatched anonymous define() module: ... ...c=c[b]});return c}function A(b,c,e,h){c=Error(c+"\nhttp://requirejs.org/docs/err... -------------------------------------------^

.../wp-content/plugins/post-thumbnail-editor/apps/requirejs/require.js line 8

This is with WP_DEBUG not set, and PTE debug enabled.

When having WP_DEBUG set to TRUE, I also get the following error:

TypeError: a is undefined ...ight:b.outerHeight(),offset:b.offset()}}a.ui=a.ui||{};var e,f,g=Math.max,h=Math.... -------------------------------------------^

.../wp-includes/js/jquery/ui/position.min.js?ver=1.11.2 line 11

jambox commented 9 years ago

@sewpafly Same experience. I definitely can't develop any WP themes or plugins with WP_DEBUG off, so I'd love if you could investigate this. Let me know if I can provide any more info that will help you get to the bottom of it. Thanks!

jambox commented 9 years ago

Thanks for working on this! I'll test this week and confirm...

sewpafly commented 9 years ago

Hopefully this fixes most of the issues, as I just pushed this version out to wordpress. :smiley:

tfrommen commented 9 years ago

Thanks for your work. Unfortunately, I get several errors (as well as warnings), when in debug mode:

pte_errors

pte_warnings

sewpafly commented 9 years ago

@tfrommen https://github.com/tfrommen, what version of firefox are you using? I see the same warnings in my firefox, but not the errors. (Maybe the download was corrupted somehow?)

On Tue, Jan 13, 2015 at 1:19 AM, Thorsten Frommen notifications@github.com wrote:

Thanks for your work. Unfortunately, I get several errors (as well as warnings), when in debug mode:

[image: pte_errors] https://cloud.githubusercontent.com/assets/6049306/5718358/a0762486-9b0d-11e4-8693-1488f0e73932.png

[image: pte_warnings] https://cloud.githubusercontent.com/assets/6049306/5718364/a7862d02-9b0d-11e4-98db-ff6f90080dce.png

— Reply to this email directly or view it on GitHub https://github.com/sewpafly/post-thumbnail-editor/issues/110#issuecomment-69716089 .

sewpafly commented 9 years ago

@tfrommen https://github.com/tfrommen, what version of firefox are you using? I see the same warnings in my firefox, but not the errors. (Maybe the download was corrupted somehow?) ​

On Tue, Jan 13, 2015 at 1:19 AM, Thorsten Frommen notifications@github.com wrote:

Thanks for your work. Unfortunately, I get several errors (as well as warnings), when in debug mode:

[image: pte_errors] https://cloud.githubusercontent.com/assets/6049306/5718358/a0762486-9b0d-11e4-8693-1488f0e73932.png

[image: pte_warnings] https://cloud.githubusercontent.com/assets/6049306/5718364/a7862d02-9b0d-11e4-98db-ff6f90080dce.png

— Reply to this email directly or view it on GitHub https://github.com/sewpafly/post-thumbnail-editor/issues/110#issuecomment-69716089 .

tfrommen commented 9 years ago

@sewpafly When I wrote this, it was Firefox 34.0.5. Now it is 35.0, and I still get these errors and warnings.

sewpafly commented 9 years ago

@tfrommen - there was still an issue with some plugins that I was having, it didn't have this error message though, so I don't know if 2.4.4 will actually fix it. Is there any other behavior that could help me troubleshoot this? Do you have any other plugins that could be conflicting? Does PTE show the loading image or does it just not start at all?

tfrommen commented 9 years ago

@sewpafly I updated to the latest version but I still get these errors and warnings. I also disabled all other plugins and switched to TwentyThirteen - still the same.

PTE loads just fine and it even seems to be working just fine - but there has to be something wrong anyway.

jambox commented 9 years ago

Just wanted to chime in and say that everything is working fine for me! I use the latest Chrome on OS X Yosemite.