Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#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.

Change History (1)

#1 @r-a-y
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #5241.

mpa4hu - Please test the patch in that ticket and comment there.

Last edited 5 years ago by r-a-y (previous) (diff)
Note: See TracTickets for help on using tickets.