Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/31/2018 06:42:13 PM (3 years ago)
Author:
boonebgorges
Message:

Prevent notices on PHP 7.2 when deleting xprofile groups.

Fixes #7916.

File:
1 edited

Legend:

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

    r11808 r12210  
    212212
    213213            // Remove profile data for the groups fields.
    214             for ( $i = 0, $count = count( $this->fields ); $i < $count; ++$i ) {
    215                 BP_XProfile_ProfileData::delete_for_field( $this->fields[$i]->id );
     214            if ( ! empty( $this->fields ) ) {
     215                for ( $i = 0, $count = count( $this->fields ); $i < $count; ++$i ) {
     216                    BP_XProfile_ProfileData::delete_for_field( $this->fields[$i]->id );
     217                }
    216218            }
    217219        }
Note: See TracChangeset for help on using the changeset viewer.