• Resolved DesigningStudios

    (@designingstudios)


    Unable to choose an image which i already have from media library as a featured image. But if i choose “Select files” i am able do it. Which means for a new image its working.

    I created a new post -> Clicked on Media Library -> Clicked on Insert Media -> I checked one image ->

    Now the button shows “Insert into post” not “Set as featured image”. If i click on the button “Insert into post” image is inserted in to post. Its not setting the image as “Featured image”.

    https://www.ads-software.com/plugins/drag-drop-featured-image/

Viewing 11 replies - 16 through 26 (of 26 total)
  • MichaelFStarke

    (@michaelfstarke)

    No such luck. I changed a setting, saved, changed it back, saved. Then I cleared all of the caches in W3 Total Cache. I cleared my local browser cache.

    Still no luck. The AJAX call never comes back. A hard refresh confirms that the API call has been made successfully, but it is unacceptable to have to hard refresh the page to use this feature.

    MichaelFStarke

    (@michaelfstarke)

    I get it to work in firefox 25.
    Still no such luck in Chrome 33.

    MichaelFStarke

    (@michaelfstarke)

    Interesting, removing the image and adding a different one without a save or a hard refresh in between still exhibits the “never comes back from the AJAX call” behavior. If however, there’s a save or a hard refresh in between, the next attempt to add is successful.

    Steps to reproduce what I’m talking about:
    1). Open a post that already has a featured image.
    2). Remove the existing featured image.
    3). Do not save or hard refresh.
    4). Set a new featured image from the media library (Choosing the same one again, or a different one from the library, neither works. Dragging and dropping a brand new one and “browsing” to upload a brand new one does however work).
    5). Notice that the AJAX call never appears to “come back”.
    6). Hard refresh the page, and notice that though the image was set, you had to hard refresh to see it updated.

    Plugin Author plizzo

    (@plizzo)

    Do these issues appear solely in Chrome or do you experience them in Firefox as well? I myself run the latest alpha of Chromium and I’d works fine there. Could you try to reinstall the plugin and see if it works?

    I’m truly sorry you are having these issues and I want to help you to my best of abilities. Do you get any errors in the console?

    MichaelFStarke

    (@michaelfstarke)

    No errors in console. Multiple (>10) successful XHR responses retrieving admin-ajax.php and load-scripts.php while waiting for the featured image API call to “come back”.

    In firefox 25, following the steps does not result in the erroneous behavior.

    I have deactivated, deleted, installed, and activated the plugin, and still no different in Chrome 33.0.1707.0 dev-m.

    Don’t worry, I work as a professional developer in the C#/ASP.NET space so I’m used to quirky browser behaviors flummoxing my efforts. If I were mad/upset/disappointed, I wouldn’t be putting in the effort to help you fix this.

    Plugin Author plizzo

    (@plizzo)

    Hello, I appreciate the help!

    I just tried in Google Chrome Version 31.0.1650.57 and it works as suspected. I’m not sure if it’s a bug with your development version of Chrome or if it’s something else but I’ve tried on 5 different installations now with different browsers and have not been able to reproduce the issues.

    Could it be that you have any conflicting that are silencing my AJAX requests?

    Nice to meet another developer. I myself work almost exclusively with PHP (and other web langs: HTML, CSS, JS) and Java but I’ll actually be working with C# on iPhone and Android-development shortly.

    Best regards,
    Jonathan

    MichaelFStarke

    (@michaelfstarke)

    The only other plugin (that I know for sure) is using the AJAX functionality is SlimStat plugin. Regardless, there aren’t errors in the Chrome javascript console, and I would expect to see XHR failures if it was clobbering your requests.

    What confuses me is that if you drag and drop, or browse to, and upload a brand new image, it works as expected, and the AJAX call “comes back” and the new image appears in the UI. It’s just when removing an existing featured image, and trying to replace it with something from the media library that it “fails” and does not appear in the UI.

    When you make the call to use an existing image from the media library, do you just set the metadata property for the thumbnail_id and save that? I do have EWW Image Optimizer installed (https://www.ads-software.com/plugins/ewww-image-optimizer/) that optimizes images and thumbnails on upload, but if you’re only setting metadata, then that shouldn’t interfere. Let me know what you think…

    My PHP skills are pretty weak. It’s been years (10+) since I’ve used it professionally. I was able to create a custom WP theme, and hack it together based on what of the language that I remembered. I was super disappointed to see that WP wasn’t leveraging the OO features of PHP5. To me, that seems like a no-brainer for simplifying the codebase and making it more modular.

    Plugin Author plizzo

    (@plizzo)

    Hello again,

    The select from media library functionally was written by myself by using the media manager API. It basically performs an Ajax query to a class method that sets the featured image using thumbnail_id.

    If successful it returns 200, if not it returns 500 and an error message. I’d something fails you should be given an error as I use alert().

    Do you have another installation where you could test the plugin, perhaps a local one without image manipulation plugins.

    I’ll go to bed now, but I’ll continue my digging after work tomorrow.

    Thanks, and good night!

    MichaelFStarke

    (@michaelfstarke)

    I uninstalled Chrome 33 and downgraded to Chrome 31 and tried again… no success…
    I deactivated all other plugins… no success…

    I don’t have a separate installation to be able to test this. Like I said , ASP.NET developer, I don’t have the WAMP stack installed to run PHP-based applications.

    Plugin Author plizzo

    (@plizzo)

    Hello, I’m sorry it doesn’t work for you, and I really don’t know why. The new implementation is using the native functions and should work properly. How is your web server configured?

    You see, on line 484 and 507 in index.php I use die() to kill the script and return the value. This works everyone I’ve tried and about a thousand people have updated without any error reports.

    I’m starting to think that maybe your web server does not like this. I’ll make a modified file and send you asap.

    MichaelFStarke

    (@michaelfstarke)

    I don’t have access to the source right now to take a look, but I’ll try when I get home.

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘Unable to set as featured image from media library’ is closed to new replies.