WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] P2 1.2.3 - clicking add media opens up error page (10 posts)

  1. mijk
    Member
    Posted 3 years ago #

    Hello,
    I've just installed the new version of P2 and it seems like there is hassle with posting images. When I click upload media button, I get 404 page in modal box.
    When I check the url, it shows: http://localhost/p2/p2/wp-admin/media-upload.php?p2-upload=true&post_id=0&type=image& (so the wp installation directory in URL looks to doubled (.../p2/p2/...)

    After rollback to 1.2.2, everything is OK.

    I'm pretty sure it has something to do with something from 1.2.3's changelog:

    * Allow image upload from front-end regardless of domain and HTTPS setting

    Just to FYI, running 1.2.2 smoothly :)

  2. Nobble
    Member
    Posted 3 years ago #

    Are you running this on localhost, ie. wamp environment? In which case I'd aks if you get the same error on a live install.

  3. mijk
    Member
    Posted 3 years ago #

    Hi, Nobble.

    If I install WP to root of the subdomain, then there is no problem. Once I give WP its own directory, the errors remain on both, live site and local apache.

    My local apache errorlog (running XAMPP):

    [Wed Mar 09 08:05:28 2011] [error] [client 127.0.0.1] File does not exist: /users/mijk/xampp/htdocs/wp-includes, referer: http://localhost/p2/?preview=1&template=p2&stylesheet=p2&preview_iframe=1&
    [Wed Mar 09 08:05:32 2011] [error] [client 127.0.0.1] File does not exist: /users/mijk/xampp/htdocs/wp-includes, referer: http://localhost/p2/
    [Wed Mar 09 08:05:34 2011] [error] [client 127.0.0.1] File does not exist: /users/mijk/htdocs/wp-includes, referer: http://localhost/p2/
    [Wed Mar 09 08:05:34 2011] [error] [client 127.0.0.1] File does not exist: /users/mijk/htdocs/wp-includes, referer: http://localhost/p2/
    [Wed Mar 09 08:05:34 2011] [error] [client 127.0.0.1] File does not exist: /users/mijk/htdocs/p2/p2, referer: http://localhost/p2/

    note local paths - correct path to WP installation is:

    /users/mijk/htdocs/p2

    Thanks for your time.

    And once again: after downgrading to 1.2.2 everything works like charm.

  4. CleverMatt
    Member
    Posted 3 years ago #

    To add to this thread, I'm seeing the same behavior on a live install (non localhost environment) of P2 1.2.3. We're using HTTPS entirely, if that makes any difference.

    I know this is a hack, but commenting out line 66 of p2/inc/p2.php fixes the problem for us.

    function url_filter( $url, $path = '' ) {
        $parsed = parse_url( $url );
        $host = ( isset( $parsed['host'] ) ) ? $parsed['host'] : '';
        // $url = preg_replace( '|https?://' . preg_quote( $host ) . '|', home_url(), $url );
        return esc_url( $url );
    }
  5. mijk
    Member
    Posted 3 years ago #

    Awesome, Matt, that's it. I have forgotten to state, that I am using https as well on both local and production site.
    Thanks.

  6. yasodhara
    Member
    Posted 3 years ago #

    Thanks!
    That's definitely an improvement, although the thickbox close icon is broken and I found that the image resize features (thumbnail, med, large, etc.) aren't working.

    This is OK for a quick Status Update though :)

    Thanks again.

  7. ChevignoN
    Member
    Posted 3 years ago #

    It is working for me =)

    Thanks

  8. jasonashaw
    Member
    Posted 3 years ago #

    I found an even simpler fix to this issue.

    Under General Settings, you'll see two fields. One for the wordpress address and one for the site address.

    I had the same URL for both:
    WordPress address (URL): http://www.sitename.com/p2
    Site address (URL): http://www.sitename.com/p2

    I was having the same problem with the .../p2/p2/...

    Simply changing the Site address (URL) to http://www.sitename.com/

    solved the problem :)

    Best,
    Jason

  9. schvenk
    Member
    Posted 3 years ago #

    The two fixes above work for the media uploader, but I'm seeing the same issue in other places - the close box on the media uploader lightbox, and more importantly on any uploaded image.

  10. mijk
    Member
    Posted 3 years ago #

    @schvenk: This plugin fixed that issue for me, I hope it will help you as well: http://wordpress.org/extend/plugins/aarons-no-ssl-flash-upload/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags