BuddyDev

Search

Replies

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Cannot update cover image #13543

    I’m definitely enjoying it so far. Always fun to learn new things and figure out how they tick, and I really like the way Buddypress is so flexible (once you get the hang of it).

    Once this particular project is finished, I’m hoping I can persuade some of my other existing clients that they’d like to add similar features so I can build on that knowledge and extend things a bit more 😉

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Cannot update cover image #13535

    @sbrajesh

    Yes indeed. I’m fairly new to Buddypress, though definitely not to WordPress and I’ll keep an eye on bporg trac myself in future, though really appreciate your support here too.

    I’ll mark this topic as resolved.

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Cannot update cover image #13524

    Ah many thanks to both of you… haven’t tried it yet but that definitely explains the issue.

    I’d worked out that it was the validate_file that was causing the problem but just couldn’t see exactly how to fix it.

    Will give it a go in the next couple of days but happy to have a promising solution.

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Cannot update cover image #13443

    Oops… just realised that although the above allows the image to be displayed upon update, it disappears again when the page is refreshed so clearly simply ignoring validate_file is not a viable fix 😉

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Cannot update cover image #13435

    Just checked this theory by removing the validate_file clause (ie. efffectively changing line 1317 back to what it was previously) and everything else works fine so that’s obviously the culprit.

    Since the path obviously exists (or the image couldn’t be displayed), I’m not sure why the validation is failing but maybe something to do with the fact that the server is localhost?

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Cannot update cover image #13433

    Ah thank you Brajesh… we’re definitely on the right tracks here.

    Comparing the previous and updated versions of that file, I see that line 1317 has been changed from –

    if ( ! is_dir( $cover_dir ) ) {

    to

    if ( 0 !== validate_file( $cover_dir ) || ! is_dir( $cover_dir ) ) {

    Not yet sure what that validate_file is checking but I assume it must be failing somehow…

    The only other significant difference in the two files is function bp_attachments_cover_image_ajax_delete() which may perhaps also have something to do with it I guess.

    With many thanks again for any thoughts.

    Warm regards
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Cannot update cover image #13416

    Hi Brajesh

    Yes the directory is created… the image is even uploaded to the correct directory eg. wp-content/uploads/buddypress/members/1/cover-image/correct.jpg. It just doesn’t appear on the page – possibly no record (or incorrect path) created in the database?

    Not sure off the top of my head where that info would be stored in the database but I’ll see if I can find it tomorrow…

    I’m using Windows 10.

    Warm regards
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Cannot update cover image #13405

    Hi Ravi

    Yes normal WordPress media uploads are working perfectly fine… indeed,as mentioned above, I can even upload a Buddypress profile photo with no problem. It’s just the cover photo that seems to be causing a problem.

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Cannot update cover image #13403

    Hi Ravi

    Thank you for your reply. Unfortunately I don’t have a live site that I can give you access to right now… however… I’ve just tested on my semi-live dev server and it seems to be working OK, which seems to leave my localhost (xampp) as the culprit. Maybe a permissions setting on the database(?) – although everything else seems to work perfectly fine (even including updating the profile photo). Maybe some other xampp setting that conflicts with the latest version of Buddypress and the way it uploads/saves the cover image?

    Since it seems to work on the dev server, I’m going to cross my fingers that it will also work live, so it’s no longer a major issue… still curious though as would be good to have the localhost version working too.

    Any thoughts?