BuddyDev

Search

Bug in Extended Friendship Request

Tagged: ,

  • Participant
    Level: Initiated
    Posts: 2
    SX 109 on #42326

    Hi all,

    it seems I just had to find a bug in the plugin extended friendship requests.

    The upgrade from v1.2.0 to v1.2.1 added some support for buddyboss / buddypress.

    So instead of one hook, you now have two hooks:

    
    add_action( 'bp_friend_requests_item', array( $this, 'show_message_legacy' ) );
    add_action( 'bp_directory_members_item', array( $this, 'show_message_nouveau' ) );
    

    You have two functions, show_message_legacy and show_message_nouveau, basically doing the same. Within those functions, there is a check, whether the hook is for BB or BP. This check seems to be buggy / reversed, so I think the ultimate function to show the message never runs.

    We use buddyboss, and I traced it, for us it’s the hook bp_friend_requests_item which is ran – but the check checks for Buddypress…

    And what’s more:
    The check is not needed at all, because you simply run the internal show_message() function anyhow.
    So why not remove show_message_legacy() and show_message_nouveau() completely from the code and simply hook into:

    
    add_action( 'bp_friend_requests_item', array( $this, 'show_message' ) );
    add_action( 'bp_directory_members_item', array( $this, 'show_message' ) );
    

    ?

    THANKS SO MUCH!!

  • Participant
    Level: Initiated
    Posts: 2
    SX 109 on #42327

    BTW: Maybe it worked back in July.
    I assume, that maybe buddyboss implemented bp_directory_members_item earlier, which was the base for you. But at least in the newest version, bp_friend_requests_item is used. bp_directory_members_item does certainly not run.

    But at least, with my suggestion, of using the same callback for both hooks, it works as expected!!

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #42329

    Hi SX,
    Thank you for reporting.

    Our team will test and get back to you with details after 3rd January.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 2
    SX 109 on #43144

    Sad to see Im contributing fixes for VERY NASTY bugs!
    And those are not at least considered it seems

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #43153

    Hi SX,
    I am very sorry we did not reply earlier. We had a miscommunication on the assignment on this task.

    Your assumption of bug is incorrect.
    I believe you are referring to this commit.

    https://github.com/sbrajesh/bp-extended-friendship-request/commit/150960aa60e57c5a71e34da5bc559126095736cd

    Please check their purpose. There is no inversion of logic. We can not guarantee that it works with current version of BuddyBoss as BuddyBoss keeps changing things.

    Please correct me where is the “VERY NASTY BUGS” that you reported?

    Thank you
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved