WordPress.org

Ready to get started?Download WordPress

Forums

Set Featured Image Broken in 3.4.2 (12 posts)

  1. Superman859
    Member
    Posted 1 year ago #

    I'm having trouble with "Set Featured Image" working in WordPress 3.4.2, vanilla install, no plugins activated, Twenty Eleven theme. This has been seen in this post and this post. However, at request of moderator, I'm opening yet another thread on this...

    Site can currently be accessed via IP only at 184.168.20.28 until domain name propogation done. Again, this is using Twenty Eleven theme without any plugins active on 3.4.2. In one of the other threads, someone mentioned mod_security as an issue for them - it's not in this case. Tested without mod_security enabled.

    admin-ajax.php never returns response to POST for set-post-thumbnail, thus resulting in the issue. Below is the error seen in Chrome console.

    POST http://184.168.20.28/wp-admin/admin-ajax.php load-scripts.php:4
    f.support.ajax.f.ajaxTransport.send load-scripts.php:4
    f.extend.ajax load-scripts.php:4
    f.each.f.(anonymous function) load-scripts.php:4
    WPSetAsThumbnail load-scripts.php:6
    onclick media-upload.php:139

    Network tab shows the outbound POST in pending state before eventually changing to failed due to lack of response. Below is a snippet from that tab.

    Request URL:http://184.168.20.28/wp-admin/admin-ajax.php
    Request Headersview source
    Accept:*/*
    Content-Type:application/x-www-form-urlencoded; charset=UTF-8
    Origin:http://184.168.20.28
    Referer:http://184.168.20.28/wp-admin/media-upload.php?post_id=68&type=image&tab=gallery
    User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
    X-Requested-With:XMLHttpRequest
    Form Dataview URL encoded
    action:set-post-thumbnail
    post_id:68
    thumbnail_id:81
    _ajax_nonce:d48124a852
    cookie:wordpress_test_cookie%3DWP%2BCookie%2Bcheck%3B%20wp-settings-1%3Deditor%253Dtinymce%2526ngg_show_update_notice196%253D1%2526imgsize%253Dfull%2526hidetb%253D1%2526align%253Dnone%3B%20wp-settings-time-1%3D1347427646

  2. Superman859
    Member
    Posted 1 year ago #

    With SCRIPT_DEBUG enabled...

    POST http://184.168.20.28/wp-admin/admin-ajax.php jquery.js:4
    f.support.ajax.f.ajaxTransport.send jquery.js:4
    f.extend.ajax jquery.js:4
    f.each.f.(anonymous function) jquery.js:4
    WPSetAsThumbnail set-post-thumbnail.dev.js:5
    onclick media-upload.php:153

    function WPSetAsThumbnail(id, nonce){
    var $link = jQuery('a#wp-post-thumbnail-' + id);

    $link.text( setPostThumbnailL10n.saving );
    jQuery.post(ajaxurl, {
    action:"set-post-thumbnail", post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie)
    }, function(str){
    var win = window.dialogArguments || opener || parent || top;
    $link.text( setPostThumbnailL10n.setThumbnail );
    if ( str == '0' ) {
    alert( setPostThumbnailL10n.error );
    } else {
    jQuery('a.wp-post-thumbnail').show();
    $link.text( setPostThumbnailL10n.done );
    $link.fadeOut( 2000 );
    win.WPSetThumbnailID(id);
    win.WPSetThumbnailHTML(str);
    }
    }
    );
    }

  3. Superman859
    Member
    Posted 1 year ago #

    From what I can tell thus far, it never makes a call to wp_ajax_set_post_thumbnail in wp-admin/admin-ajax.php. I've never worked with the wordpress code before, but based on what I can tell in admin-ajax.php and ajax-actions.php that appears to be the function call we enter when we get a POST to admin-ajax.php with action set-post-thumbnail.

  4. Superman859
    Member
    Posted 1 year ago #

    Ok, next step I've decided the packet isn't even getting to the server. tcpdump never shows the incoming packet. The admin-ajax.php accesses seen in the apache access log around the same time were generated by auto save, not set-post-thumbnail action.

    It sounds like GoDaddy may indeed be dropping these particular packets.

  5. calligrageek
    Member
    Posted 1 year ago #

    Hi Superman859,
    Thanks for starting another thread about this - I'm a newbie with this issue too.
    However I have a different hosting company (HostGator).
    I'm not as technical so can't really give you much more than the info below:
    site: http://www.calligrageek.com
    page with issue : http://calligrageek.com/panic-catching-the-big-fish/
    I hope someone can help us with this soon.

  6. tommcgee
    Member
    Posted 1 year ago #

    Testing it on a server that doesn't work, against one where it does, it might be that the outgoing request to set the thumbnail is empty. Firebug should show something like this in the "Post" tab:

    _ajax_nonce	0c3d41d6bf
    action	set-post-thumbnail
    cookie	(cookie stuff here)
    post_id	4098
    thumbnail_id	4099

    But in the non-working one the request has no details at all, it just goes red and shows "aborted." In fact there are no post parameters at all. If you right-click on the "Aborted" request, it's not even an option, unlike the autosave ones.

    When I look closely in the script debugger, it shows (shortened) something that an alert is supposed to be thrown if e=="0", "Object SetThumbnail error='Could not set that as t...a different attachment.'" but it isn't. Doesn't look like 'e' gets defined at all, but I'm not sure.

    By the way, the non-working version is a multisite installation.

  7. calligrageek
    Member
    Posted 1 year ago #

    Thanks for the response tommcgee, could you please explain in layman terms if I need to contact the hosting company about this? Sorry I'm still new & not technical...

    Thank you

  8. tommcgee
    Member
    Posted 1 year ago #

    I'm going to dig into this a little more tomorrow, but I doubt it's a hosting issue. We're self-hosted and as far as I know nothing changed in our security.

  9. calligrageek
    Member
    Posted 1 year ago #

    Thanks again tommcgee, much appreciated!

  10. calligrageek
    Member
    Posted 1 year ago #

    Hi Tommcgee / Superman859, Just a little update for you, My latest post worked fine with the featured image. Not sure if something was changed since last week but the original post I had an issue with still has it.

  11. JoshRowland@gmail.com
    Member
    Posted 11 months ago #

    Was this issue ever resolved?

  12. tommcgee
    Member
    Posted 11 months ago #

    I think so. I was running the "Drag & Drop Featured Image" ever since 3.4.2, but I just disabled it on my 3.5.2 installation and featured images seem to work with my setup.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.