[buddypress-trac] [BuddyPress Trac] #5607: Trying to get property of non-object

buddypress-trac noreply at wordpress.org
Fri May 2 22:04:39 UTC 2014

#5607: Trying to get property of non-object
 Reporter:  mpa4hu        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:
 There is notice about undefined object (many of them) on users page and
 activity permalink.

 For exampe

 Notice: Trying to get property of non-object in /home/radikal/buddypress
 /wp-includes/query.php on line 4207

 I tested this with all plugins turned off and default theme.

 Interesting fact that this only happens when {{{BP_ENABLE_ROOT_PROFILES}}}
 set to true.

 I dig into this and found place where problem is.

 Function {{{bp_core_load_template}}} in bp-core-catchuri.php after

         // Set the root object as the current wp_query-ied item
         $object_id = 0;
         foreach ( (array) $bp->pages as $page ) {
                 if ( $page->name ==
 $bp->unfiltered_uri[$bp->unfiltered_uri_offset] ) {
                         $object_id = $page->id;

 $object_id is still 0 since $page->name and
 $bp->unfiltered_uri[$bp->unfiltered_uri_offset] are not equal.

 {{{$bp->unfiltered_uri[$bp->unfiltered_uri_offset]}}} will be users login
 and {{{$page->name}}} is "activity"

 Hope this helps, I'll report if find more.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5607>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list