Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/09/2015 12:28:55 AM (9 years ago)
Author:
boonebgorges
Message:

BP_XProfile_Group::save() should not return false when a save is successful but no rows are updated.

It ought to be semantically possible to save a fieldgroup without making any
changes to the group. Otherwise the return values of the save() method are
inconsistent, and the 'xprofile_group_after_save' hook is not fired reliably.

Props Offereins.
Fixes #6552.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-group.php

    r9974 r10002  
    141141        $query = $wpdb->query( $sql );
    142142
    143         // Bail if query fails
    144         if ( empty( $query ) || is_wp_error( $query ) ) {
     143        // Bail if query fails. If `$query` is 0, it means the save was successful, but no fields were updated.
     144        if ( false === $query || is_wp_error( $query ) ) {
    145145            return false;
    146146        }
Note: See TracChangeset for help on using the changeset viewer.