#5607 closed defect (bug) (duplicate)
Trying to get property of non-object
Reported by: | mpa4hu | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Core | Keywords: | |
Cc: | mpa4hu@… |
Description
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.
Duplicate of #5241.
mpa4hu - Please test the patch in that ticket and comment there.