BuddyDev

Search

Nasty “bug” in BP_Profile_Completion

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

    Dear Devs,

    we fought with a nasty behaviour within BP_Profile_Completion for months now which prevents users from being able to access the site.

    The bug and original root cause might lay somewhere else, but still BP_Profile_Completion has a not 100% fail-safe programmed behaviour.

    Within has_required_field_data(), you check whether the user has filled the required profile fields. It may happen that within xprofile_data table, specific data is entered redundantly. Hence, the query

    SELECT field_id, value FROM {$table} WHERE user_id = %d AND field_id IN {$fields_list}
    may possibly (which was the case pretty often for us) MORE rows than unique field_ids.

    You could simply add ” GROUP BY field_id” to the end of the query, making sure, e.g. for 6 required fields, that only 6 rows are returned. OR simply change the line:

    if ( count( $profile_entries ) != count( $required_fields ) ) {
    to:
    if ( count( $profile_entries ) < count( $required_fields ) ) {

    (because we need AT LEAST X profile entries).
    This way, it greatly improves robustness.

    We fixed it ourselves – and simply hope – if you ever gonna release a new version, please consider fixing it as well.

    Thanks

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

    Hi,
    Welcome to Buddydev.

    Thank you for reporting the issue and proposing the solution. This might have append on multi check/options field.

    I appreciate you sharing the solution. The GROUP BY clause will definatey fix it. We will update the code with it.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 1
    Aleks on #50173

    You must be joking.
    It’s been nearly 2 years since someone contributed the FIX above.

    And in the latest version released 4 days ago, it is still BUGGY!
    Incredible!

    Wha type of devs are you? xD

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

    Hi Aleks,
    Welcome to BuddyDev and thank you for reminding us about the issue.
    I am sorry, we missed this as it does not happen in normal fields.
    There will be an update available in next 24 hours.

    For your last question:- We are just the normal kind of devs who might miss couple of topics sometimes but when reminded, we make sure to resolve them.

    Thank you
    Brajesh

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

    Please upgrade to 1.1.0 . it contains the fix.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved