Title: PHP Error on group retrieval
Last modified: July 25, 2017

---

# PHP Error on group retrieval

 *  Resolved [Alkerion](https://wordpress.org/support/users/alkerion/)
 * (@alkerion)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/php-error-on-group-retrieval/)
 * HI !
 * I have this error happening nearly every second :
 * PHP Notice: Trying to get property of non-object in /home/clients/d23…49/web3/
   wp-content/plugins/press-permit-core/groups-retrieval_pp.php on line 212
 * Any idea what’s going wrong ?
 * Thanks for support
 * WP: 4.8
    PPC: 2.3.20 PHP: 7.0.7

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [Alkerion](https://wordpress.org/support/users/alkerion/)
 * (@alkerion)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/php-error-on-group-retrieval/#post-9348951)
 * Hi !
 * I’ve tried fresh install, no changes, error still raised.
 * I’ve tried to rollback to 2.3.19, no error anymore.
 * Error only raised with 2.3.20
 *  Thread Starter [Alkerion](https://wordpress.org/support/users/alkerion/)
 * (@alkerion)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/php-error-on-group-retrieval/#post-9356116)
 * Hi !
 * I’ve remove the new buggy code section from groups-retrieval_pp.php and no error
   anymore.
 * Hope to obtain support and fix.
 *     ```
       // ensure current WP roles are recognized even if pp_group_members entries out of sync
       			if ( ! empty( $args['wp_roles'] ) ) {
       				foreach( $args['wp_roles'] as $role_name ) { 
       					if ( is_object( $role_name ) )
       						$role_name = $role_name->name;
   
       					$matched = false;
       					foreach( $user_groups as $ug ) {
       						if ( ! empty( $ug->metagroup_id ) && ( $ug->metagroup_id == $role_name ) && ( 'wp_role' == $ug->metagroup_type ) ) {
       							$matched = true;
       							break;
       						}
       					}
   
       					if ( ! $matched ) {
       						$role_group = pp_get_metagroup( 'wp_role', $role_name );
       						$user_groups[$role_group->ID] = $role_group;
       					}
       				}
       			}
       ```
   
    -  This reply was modified 8 years, 10 months ago by [Alkerion](https://wordpress.org/support/users/alkerion/).
 *  Plugin Author [Kevin Behrens](https://wordpress.org/support/users/kevinb/)
 * (@kevinb)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/php-error-on-group-retrieval/#post-9402410)
 * Sorry about the PHP Notice. It’s fixed in Press Permit Core 2.3.21
 *  Thread Starter [Alkerion](https://wordpress.org/support/users/alkerion/)
 * (@alkerion)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/php-error-on-group-retrieval/#post-9402487)
 * Hi Kevin,
 * Thanks a lot for the quick fix, no log anymore 🙂
 * Regards

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP Error on group retrieval’ is closed to new replies.

 * ![](https://ps.w.org/press-permit-core/assets/icon-256x256.png?rev=3409953)
 * [PublishPress Permissions: Control User Access for Posts, Pages, Categories, Tags](https://wordpress.org/plugins/press-permit-core/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/press-permit-core/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/press-permit-core/)
 * [Active Topics](https://wordpress.org/support/plugin/press-permit-core/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/press-permit-core/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/press-permit-core/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Alkerion](https://wordpress.org/support/users/alkerion/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/php-error-on-group-retrieval/#post-9402487)
 * Status: resolved