Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_core_avatar_v1 returns local path to avatar


  • Brad Williams
    Participant

    @williamsba1

    I have a really strange avatar issue going on. I’m using the latest BuddyPress trunk (821) and MU 2.7 for reference.

    For some strange reason when I upload an Avatar the usermeta field in the database that stores the location of that avatar contains the local path on my web server like this:

    bp_core_avatar_v1 = D:WebsitesWebsitesPHPCitizenAccess/wp-content/blogs.dir/1/files/avatars/1/aad_logo-avatar1.jpg

    bp_core_avatar_v1_path = D:WebsitesWebsitesPHPCitizenAccess/wp-content/blogs.dir/1/files/avatars/1/aad_logo-avatar1.jpg

    Notice how D:Websites….. is listed when it should not be. So of course on the website the img src is broke and displayed like so:

    <img class=”avatar photo” height=”150″ width=”150″ alt=”” src=”http://mydomain.com/D:WebsitesWebsitesPHPCitizenAccess/wp-content/blogs.dir/1/files/avatars/1/aad_logo-avatar2.jpg”/>

    Any ideas on what could be causing this issue? I’ve search the forum and tickets and haven’t seen any mention of this before.

Viewing 8 replies - 1 through 8 (of 8 total)

  • yu
    Participant

    @gerbilo

    have you seen your blog options (/wp-admin/wpmu-blogs.php?action=editblog&id=1 – for main blog, for example)? there are some ‘Upload url’ options to check out.


    Burt Adsit
    Participant

    @burtadsit

    Howdy. This is a know bug running on windows. Patience. I have the same problem with my dev windows box.


    Brad Williams
    Participant

    @williamsba1

    Nice to know I’m not the only one. I didn’t see a ticket for this in trac, but I’m assuming there is one correct?


    Brad Williams
    Participant

    @williamsba1


    Burt Adsit
    Participant

    @burtadsit

    I stuck that ticket in there as part of something else then forgot about it. Normally I fix things I find but got sidetracked with other things. Feel free to track it down and fix it. :)


    Brad Williams
    Participant

    @williamsba1

    Working on this today. I’ll post any updates


    Brad Williams
    Participant

    @williamsba1

    Well I found the problem, now trying to figure out a good solution.

    The form field orig on the final crop page holds this value:

    <input type=”hidden” name=”orig” value=”D:Websitesdirectory/wp-content/blogs.dir/1/files/avatars/1//logo.png” />

    Which is correct. When the value is posted and displayed it comes out like this:

    D:\Websites\WebsitesPHP\directory/wp-content/blogs.dir/1/files/avatars/1/logo.jpg

    For some reason posting that value is adding an extra backslash to each backslash in the URL.

    Working on a solution now


    Brad Williams
    Participant

    @williamsba1

    Fixed. I added the stripslashes function around the post value to remove the double slashes back to single slashes. I updated the ticket as well:

    https://trac.buddypress.org/ticket/265

    Not sure I updated the ticket properly so feel free to fix if it’s wrong.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘bp_core_avatar_v1 returns local path to avatar’ is closed to new replies.
Skip to toolbar