error message trying to use roles in Moodle 2

error message trying to use roles in Moodle 2

by Francis Vila -
Number of replies: 0

I am trying to show users only the courses/categories that concern them. (in Moodle 2)

I created a role that has no rights at all (call it noRightsRole)-

  • based on Student architype,
  • opened the Advanced features
  • I laboriously clicked Prohibit on all the rights
    (well over a hundred clicks, but no "view categories" rights or equivalent)
  • I checked System among tghe contexts in which it can apply

I then created a user, and defined that at System level its role was noRightsRole

Then I changed Student role so that I could assign the Student role in the context of a Category

Then I navigated to the category I wanted the user to see, and defined that in that category, my user had Student rights

When I logged in using my new user, I got an error message:

Coding error detected, it must be fixed by a programmenr: get_in_or_equal() does not accept empty arrays
More info about this error: Stack trace

* line 578 of \lib\dml\moodle_database.php: coding_exception thrown
* line 1939 of \course\lib.php: call to moodle\databoase->get_in_or_equal()
* line 208 of \index.php: call to get\course\category_tree()

Note I had to type all this in, there's an error message from firefox when I try to paste text in this box

Average of ratings: -