-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
2.2
-
None
-
MOODLE_22_STABLE
If a user has a role that gives them enough permissions to see the Add and edit category buttons on a category page, when they try to use the page it can produce a Fatal error similar to:
Fatal error: Call to a member function get() on a non-object in /var/www/html/course/editcategory.php on line 139
How to reproduce:
- Create a role that can be assigned at the Category level
- Give the role the following two capabilities: moodle/category:manage and moodle/site:manageblocks (these seem to be the miminum permissions required to enable editing on Categories)
- Enrol a user to this role on a category
- Login to this page as the user, and turn editing on.
- Click on either the 'Edit this category' or 'Add a sub-category' button. the error will now be generated.
The error looks as though it will not occur only if a user can see the Site Administration -> Courses -> Add/edit courses node in the Settings block.