• 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 https://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:https://184.168.20.28/wp-admin/admin-ajax.php
    Request Headersview source
    Accept:*/*
    Content-Type:application/x-www-form-urlencoded; charset=UTF-8
    Origin:https://184.168.20.28
    Referer:https://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

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter superman859

    (@superman859)

    With SCRIPT_DEBUG enabled…

    POST https://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);
    }
    }
    );
    }

    Thread Starter superman859

    (@superman859)

    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.

    Thread Starter superman859

    (@superman859)

    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.

    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: https://www.calligrageek.com
    page with issue : https://calligrageek.com/panic-catching-the-big-fish/
    I hope someone can help us with this soon.

    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.

    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

    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.

    Thanks again tommcgee, much appreciated!

    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.

    Was this issue ever resolved?

    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.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Set Featured Image Broken in 3.4.2’ is closed to new replies.