Hi All,
I'm on Moodle 3.5.2
I'm creating a local plugin and i'm trying to add a settings page to display a list of categories that will be used in my plugin. I've written the code below and it lives in local/catalogue/settings.php
if ($ADMIN->fulltree) {
$settings->add(new admin_setting_heading(
'categoryconfig',
get_string('setting:categoryconfig', 'catalogue'),
get_string('setting:categoryconfig_desc', 'catalogue')
));
$settings->add(new admin_setting_configmultiselect(
'catalogue_category_list',
get_string('setting:categorylist_desc', 'catalogue'),
get_string('setting:categorylist', 'catalogue'),
array(),
$cats
));
}
I keep getting an error "Exception - Call to a member function add() on null" and I don't know what this means. I can't see what i'm doing wrong with my $settings variable for it to not work.