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

door Jeff Gardener -
Aantal antwoorden: 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

Gemiddelde van de beoordelingen:  -
Als antwoord op Jeff Gardener

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

door Andreas Grabs -
Foto van Core developers Foto van Particularly helpful Moodlers Foto van Peer reviewers Foto van Plugin developers Foto van 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

Gemiddelde van de beoordelingen: Useful (2)
Als antwoord op Andreas Grabs

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

door Flotter Totte -
Foto van 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
Gemiddelde van de beoordelingen:  -