We have moved to Github. Please open tickets there.

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#2727 closed Defect (invalid)

page_owner_entity() returns non-object

Reported by: hllmstrbg Owned by:
Priority: normal Milestone: Needs Review
Component: Core Version: 1.7
Severity: major Keywords: page_owner_entity() non-object
Cc: brett@… Difficulty:

Description

Hello, everyone!
There's a bug I encountered, which occurs in Elgg 1.7.1.

On line 103 in blog/start.php insert the following:
add_submenu_item($page_owner instanceof ElggGroup ? sprintf(elgg_echo('blog:groupback'), $page_owner->name) : sprintf(elgg_echo('blog:userback'), $page_owner->name), $page_owner->getURL(), 'boxes');

I get a blank page and the error is:
[11-Dec-2010 00:44:40] PHP Fatal error: Call to a member function getURL() on a non-object in D:\xampp\avatar\mod\blog\start.php on line 103

I just don't get why at the time page_owner_entity() returns non-object.

I would highly appreciate any help and/or assistance!

Regards,
Martin

Change History (3)

comment:1 Changed 2 years ago by hllmstrbg

actually I forgot to say that the problem comes when invoking getURL() method on the page_owner_entity().

Regards,
Martin

comment:2 Changed 2 years ago by brettp

  • Resolution set to invalid
  • Status changed from new to closed

page_owner_entity() will return nothing if it can't determine the page owner. Please use the community site for help with writing custom code.

comment:3 Changed 2 years ago by hllmstrbg

Alright, thanks for the reply, Brett!

Regards

Note: See TracTickets for help on using tickets.