Support » Fixing WordPress » Can’t insert picture in post with 2.5

  • AnneTanne

    (@annetanne)


    I have been trying to insert an uploaded picture into a post since I (locally) installed 2.5 RC1. (Now upgraded to 2.5)
    I have no problems uploading my pictures, but then it seems to go wrong.
    I hit the add Media -> add a picture-button, then I choose the ‘Media library’ where I choose the picture I want.
    Title, caption and description are already entered, I chose to have no link, choose the alignment and size I want, hit ‘insert to post’, and then the middle of the ‘greybox’ turns white, and nothing else happen. When I close the graybox, by hitting on ‘x’, (which is the only thing I can do), nothing has changed to my post…

    Maybe (as a non-english-speaking user) there is something I misunderstood, but when that’s so, it should be made a little bit easier.

Viewing 15 replies - 31 through 45 (of 86 total)
  • wkessel

    (@wkessel)

    OK… I know this is resolved, in the forum at least, but the problem isn’t. I’ll create a new topic and post this there as well.

    1. Checked server error logs.
    2. Determined problem was in the \wp-admin\includes\image.php file, line 138.
    3. Went into debug mode.
    4. Added the following line immediately BEFORE $image=, knocking that line down one:
    mail("me@myaddress.com","imagedebug",$file);
    It worked cross-browser!
    5. Commented inserted line out: it worked cross-browser still.
    6. Deleted line, but left line 138 blank: it still works.
    7. Deleted line, moving the $image= back to line 138: it still works.

    Conclusion? There’s a line-break or a line-ending in there that’s incorrect: perhaps a UNIX, or a Windows or a Mac thing, but it’s not correct.

    Glotzfisch

    (@glotzfisch)

    Hi all,
    finally I fixed my problem with uploading files, maybe it helps some of you, too.
    As I said before, I had the problem only when trying to add an image to a post that was accompanied by a link url. When I cleared this field, the insert worked. So I finally switched on my error console and found that it’s posting

    top.send_to_editor('<a href=''http://www.wordpress.org''><img src="http://someurl.org/blog/wp-content/uploads/2008/04/simg_0013b-450x348.jpg" alt="" title="simg_0013b" width="450" height="348" class="alignnone size-medium wp-image-10" /></a>');

    So there was clearly a quotes mismatch in the URL. It took me some time to find the culprit, but finally, I got him:
    in
    /wp-admin/includes/media.php
    In the function get_image_send_to_editor I replaced the following:
    old:

    if ( $url )
        $html = "<a href='".attribute_escape($url)."'$rel>$html</a>";

    new:

    if ( $url )
        $html = "<a href=\"".attribute_escape($url)."\"$rel>$html</a>";

    Sunlizzard

    (@sunlizzard)

    I had the same problem: could upload but couldn’t insert any media into a post. The window just went blank.
    I de-activated the “Themed Login and Register 1.1” plugin and now it works perfectly.
    My best guess is to check the plugin compatibility list and see if you have any plugins from the incompatible list and de-activate it. Just my two cents. Hope it helps someone.

    eddiebhome

    (@eddiebhome)

    I don’t think it’s a plugin problem because I haven’t added any plugins. The problem seems to be intermitent. I saw someone else was able to insert into post by logging in under an editors login. I’ve been adding pics tonight and all of a sudden it would no longer insert in post. Tried logging out and logging back in under same admin id and then it works. This is wierd.

    Glotzfisch

    (@glotzfisch)

    hm it seems my posts are being caught by akismet… 🙁 probably because of the “links”
    Ok here’s the short version.
    I had the problem only when inserting an image into a post that was accompanied by a link. So I switched on the debugger and found a quoting mismatch in
    /wp-admin/includes/media.php

    In the function get_image_send_to_editor, when building the variable $html, the single quotes (‘) have to be replaced by escaped double quotes (\”).

    hope this one gets through and helps some of you.

    amnesiak

    (@amnesiak)

    sadly I’ve still got this issue.
    (can upload and add images with FF but not any other browser)

    To be more specific, the images DO upload, I see them in the FTP folder, however when I click ‘show’ nothing shows up. It does nothing.

    I went the extra mile and installed WordPress on a brand new domain, (absolutely fresh), but I still have the same problem.

    My friend all the way in Japan (who the blog is for) also has the same issues)

    davidpreston

    (@davidpreston)

    Hello Everyone

    Can I add my problem to the list?

    I’m new to blogging and was getting quite excited about using WordPress after I had made my first test post to my blog. Then disaster: the next time I came to use WordPress I was told there was an upgrade, which I battled with. I’ve since tried to upload images for the first time, which seem to upload but don’t display. I’m not sure whether it is because of my general inexperience with WordPress or because of the upgrade. I’ve followed the forum discussions about image problems with the upgrade and taken all the suggested steps but still no success.
    The name of the image shows on my blog as a link, but not the image itself. When I click on the link I get the following error message:

    You don’t have permission to access /wp-content/uploads/2008/04/windowslivewriteraboutmeandthissite-e575david-2.jpg on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    I’m getting very disillusioned with WordPress and am wondering if I should just go and use some other blogging software.

    Any suggestions, please.

    eeeoa

    (@eeeoa)

    Hi,
    I have the same issue on WordPress 2.5.1: I can upload a picture but when inserting in the post, I got a blank page…
    Thanks for your help.

    SteveJava

    (@stevejava)

    This has been an odd problem that I’ve experienced since installed WP 2.5 fresh (just started blogging!) and has continued since after upgrading to WP 2.5.1.

    I predominantly use a Mac for blogging, and the 2 browsers I use are Firefox 2.x and Safari 3.1.1. On both, under normal browser usage, I have no problems uploading new images to the blog, but once I try the “Insert to Post” button in the Add Media pop-up dialog, the entire dialog turns blanked-out white except for the Close Dialog “X” button in the upper-right corner. Once I exit out of the dialog, there’s nothing inserted into the HTML of the post, but the Media Library clearly shows that the images were uploaded and associated with the post.

    Based upon what a previous poster wrote, I tried the following:

    1. On an opened browser, I opened a New Browser Window.
    2. I went to my blog and immediately logged in to write a new post.
    3. I typed in some demo text.
    4. I hit Add Media.
    5. The Add Media dialog came up.
    6. I specified a local file to upload to the blog. I waited for the upload to complete, and filled in some file info.
    7. For the URL, I cleared out the field. I could also just click that None button. That doesn’t seem to matter.
    8. I then clicked the Insert to Post.

    At that point, the Insert to Post works; if I look at the HTML, I will see the img tag placed properly. If I highlight OR delete the image I just inserted, and click the Add Media again to re-do this, I can actually hit the Insert to Post without clearing out the URL field, and it will insert the correct HTML with the URL tag and the img tag properly.

    It really seems as if there’s a toggle/boolean/flag/state that’s not being properly accounted for. If I deviate from the procedure I listed above, I can’t use the Insert to Post, so I get the blanked-white dialog. Also, the procedure only works for that single post; if I start another post, it won’t work unless I close out the current browser window pointing to the blog and open a brand-new browser window. The procedure will also work once for an existing post, so when I go to Manage > Posts, and pick a draft or even a published post straight-away, and perform my workaround, then I can use Insert to Post.

    Anybody with similar experiences?

    BTW, I tried editing the wp-admin/includes/media.php, but that didn’t matter for my blog.

    BBTW, this is one of the reasons why I’m searching for a decent blogging client… 🙂

    SteveJava

    (@stevejava)

    Here’s a quick update:

    How many folks are also redirecting/morphing URLs/URNs for your blogs?

    One detail I just noticed before because I didn’t check the JS console output on my browsers until after I posted earlier is this:

    When I was hitting my blog using a redirected URL, I am getting the following JS error:
    Error: uncaught exception: Permission denied to get property Window.send_to_editor

    When I see that, I sometimes think there’s a problem with cross-site scripting, depending on the object being fetched.

    So I deliberately tried hitting my blog with its plain longer URL, and the JS error goes away, and I can Insert to Post.

    Funny, eh?

    I am having identical issue with 2.5.1. Images will upload, but when you try to insert them into the post, the screen goes white and hangs up. I tried addressing the coding/quote issue in media.php as suggested by Glotzfisch, but that didn’t work for me. Also tried clearing the URL as per a later suggestion, but that didn’t work either . . . .

    Any thoughts or help out there??? This seems a pretty serious issue.

    (I am fairly new to WordPress . . . I like the functionality – but have been less-than-impressed with: a) the bugginess of pluggins in general; and b) the lack of user-friendliness of the WordPress.org site. OSCommerce, for example, has way more robust searching, sorting, support, etc.).

    Anyway, hope we can overcome this issue and move on.

    PS: There’s also a pretty frustrating rant on the same topic over at WordPress.com . . . The suggestion they had of upgrading Flash was also a non-starter.

    http://en.forums.wordpress.com/topic.php?id=27367

    jimide01 how do you log into your page? I find if I use index.php and click on “Log in” on the start page I don’t have the image insert problem. If I use wp-login.php I have the problem.

    glh3913,

    Logging in via index instead of wp-login worked!
    Not sure I understand the issue, but thanks very much for the valuable suggestion.

    I get the problem (can upload but can’t insert the image in 2.5.1) every time and no matter how I log in.

Viewing 15 replies - 31 through 45 (of 86 total)
  • The topic ‘Can’t insert picture in post with 2.5’ is closed to new replies.