Fatal error: Call to a member function getType() on null
elgg_register_plugin_hook_handler('register', 'menu:title', 'title_menu_handler');
function title_menu_handler($hook, $type, $items, $params) {
$owner = $params['entity'];
register_error($owner->getType());// only for testing
if($owner){
if ($owner->getType() == 'group') {
foreach ($items as $key => $item) {
// do something
}
}
return $items;
}
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Jerome Bakker@jeabakker
Jerome Bakker - 0 likes
- Reuven@reuven
Reuven - 0 likes
You must log in to post replies.In the title menu there isn't necessarily an 'entity' in params, that's the error.
That's because in order to show information there we have to fake some menu's but the title menu has to many variables on order to fake correctly.
Lot's of menu items are dependent on page owner, context or something else.
I understand.
Thank you