Does a local plugin lib.php have to include local_{pluginname}_extend_settings_navigation

Does a local plugin lib.php have to include local_{pluginname}_extend_settings_navigation

by Jeff Gardener -
Number of replies: 2

Hi, I'm still trying to figure all this out. I'm attempting to create a plugin and I need to have a link for it in the navigation.

I think for where I want the link to go I need to use : 
function local_{pluginname}_extend_navigation(global_navigation $nav)

But if I don't have: function local_{pluginname}_extend_settings_navigation(settings_navigation $nav, context $context) defined in my lib.php file I get an error saying 

Exception - Call to undefined function local_{pluginname}_extend_settings_navigation()

So I wonder if that function has to exist?

Thanks

Average of ratings: -
In reply to Jeff Gardener

Re: Does a local plugin lib.php have to include local_{pluginname}_extend_settings_navigation

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Jeff,

those hook functions are cached by moodle. So if you remove such function from your lib.php you have to purge the cache so moodle does know about it.

Best regards
Andreas

Average of ratings: Useful (2)
In reply to Andreas Grabs

Re: Does a local plugin lib.php have to include local_{pluginname}_extend_settings_navigation

by Flotter Totte -
Picture of Plugin developers
I had the same problem as Jeff. Purging cache (alone) did not help. What I did is:
1. Uninstalled the plugin (until the point where all DB items were reomved)
2. Purged all caches
3. Re-installed the plugin