I have the following in my local_mydevtool plugin's lib.php file which works fine in Moodle 2.5:
<?php // Filename: /local/mydevtool/lib.php
function local_mydevtool_extends_settings_navigation($nav, $context) {
global $PAGE;
// Append My Dev Tool to the end of the Home > Administration > Site Administration > Development.
$url = new moodle_url('/local/mydevtool/');
$settingsnavnode = $nav->find('development', navigation_node::TYPE_SETTING);
$settingsnavnode->add('My Dev Tool', $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/settings', ''));
}
?>
As of Moodle 2.6 and 2.7, I get the following error when I try to access any Moodle page that is not listed under the Site Administration menu (when the Site Administration dynamic menu is not loaded by default):
Fatal Error: Call to member function add() on a non-object in /local/mydevtool/lib.php on line 8. Line 8 is the line that starts with "$settingsnavnode->add(...".
What it is obviously complaining about is that the line right above it isn't finding the Development node in the Site Administrator menu.
I've tried referring to the documentation at http://docs.moodle.org/dev/Navigation_API but there doesn't seem to be relevant information that would be helpful and I haven't found any similar examples implemented in Moodle's own source code.
Any suggestions on how to get it working again in Moodle 2.6 and Moodle 2.7 would be greatly appreciated.
Best regards,
Michael