• Hi,

    This week I noticed that when I try to upload media on the Edit Page screen it fails. Essentially after clicking “Select Files” and choosing a file, nothing happens, or I get a 1/10th filled progress bar. When I deactivate this plugin, everything works again. I’ve swapped out WordPress versions 4.1, 4.1.1, and 4.1.2, and this bug occurs in each of them.

    It is due to a Javascript error in the following file:

    /wp-admin/load-scripts.php?c=1&load%5B%5D=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-comments,sug&load%5B%5D=gest,postbox,post,editor-expand,backbone,wp-util,wp-backbone,media-models,wp-plupload,mediaelement,wp-mediaelement,media-views,m&load%5B%5D=edia-editor,media-audiovideo,wp-playlist,mce-view,imgareaselect,image-edit,svg-painter,wp-auth-check,jquery-ui-menu,jquery-ui-au&load%5B%5D=tocomplete,word-count,editor,wplink&ver=4.1.2

    The error itself occurs on line 83 and the message (in Chrome) is:
    “Uncaught TypeError: Cannot read property ‘text’ of undefined”

    It occurs in this function:
    info:function(){var a,b=this.queue,c=0;b.length&&(a=this.queue.find(function(a,b){return c=b,a.get("uploading")}),this.$index.text(c+1),this.$total.text(b.length),this.$filename.html(a?this.filename(a.get("filename")):""))}

    I’ve done testing in Chromium (ubuntu) and Chrome for Safari. Hopefully the error info is helpful. Thanks for a great plugin.

    – Micah

    https://wordpress.org/plugins/post-thumbnail-editor/

Viewing 15 replies - 16 through 30 (of 30 total)
  • for me the issue is with WordPress 4.2.2 with Post Thumbnail Editor Version 2.4.4 AND WordPress SEO Version 2.1.1 both installed and activated. If I disable WordPress SEO, PTE works like a charm. Can’t you guys get along 😉 Thanks for the support, love the plugin by the way.

    Here I am with the same issue.

    Having both Post Thumbnail Editor 2.4.4 and WordPress SEO by Yoast 2.1.1 breaks the upload and gives an error (I described it here more precisely).

    Post Thumbnail Editor is really nice, but WP SEO by Yoast is essential, so I’ll remove the editor untill this is fixed.

    Thank you

    Same issue here. Seems to possibly related to using Visual Composer, and or the Jupiter theme.

    Plugin Author sewpafly

    (@sewpafly)

    I wonder if it’s an SEO setting, because I have both plugins installed and enabled and still can’t duplicate it…

    Here’s another clue: I was getting the same problem, so I dug around a bit and was able to get the plugin working on WP 4.2.2, Yoast 2.1.1, PTE 2.4.4…

    made a change to: post-thumbnail-editor/js/snippets/pte_enable_media.js starting at line 84…

    // Set the featuredImage object asthis` for the frame function…
    oldFeaturedImageFrame = $.proxy( wp.media.featuredImage.frame, wp.media.featuredImage );
    wp.media.featuredImage.frame = function() {
    var frame = oldFeaturedImageFrame()
    — frame.setState(‘featured-image’)
    ++ frame.setState(‘library’)
    return frame;
    }`

    Plugin Author sewpafly

    (@sewpafly)

    @phonglong – That’s fantastic. Thanks!

    Can anyone corroborate the fix? If so, I can push out an update with that fix.

    I have applied the patch to two sites that have been experiencing this issue.

    The media upload process works when attempting to upload from within a post or page.

    In other words. This fixes the issue for me. ^_^

    Same problem.

    Herbert’s suggestion of adding the following to the theme functions.php worked a treat:

    /*-----------------------------------------------------------------------------------*/
    /** temp fix for thumbnaileditor v. 2.4.4 upload error in page edit uploads **/
    /** In order to use PTE with this action removed, you can set a featured image (and then launch the PTE editor from there) or use the standalone media library. **/
    /*-----------------------------------------------------------------------------------*/
    remove_action('dbx_post_advanced', 'pte_edit_form_hook_redirect');
    Reüel

    (@pronamic_reuel)

    @phonglong Thanks for the fix!

    @sewpafly I can confirm the @phonglong fix solves this issue for me.

    @phonglong change worked for me as well. Thanks for the fix!

    Hi @sewpafly,
    you will push this fix in the next version or the manual “remove_action fix” is the final solution?

    😉 Thanks

    Plugin Author sewpafly

    (@sewpafly)

    Sorry all, I’ll push out this fix today!

    Same problem happened to me just now, found that topic, updated to the latest version and it works again. Thanks!

    the update fixes my issue on WP 4.1.5 with WP-SEO 2.1.1, thanks!

Viewing 15 replies - 16 through 30 (of 30 total)
  • The topic ‘JS bug prevents uploading media in Page/Post editor’ is closed to new replies.