Moodle Community Sites

Add a resource/activity dropdown menus missing for users assigned the role of teacher

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Component/s: moodle.org
  • Labels:
    None

Description

When users assigned the role of teacher (aka facilitator) in the course context turn editing on, the "Add a resource" and "Add an activity" dropdown menus do not appear.

This problem has been reported in several courses - Spanish, Dutch and Sinhala.

The problem does not affect users assigned the role of admin.

Issue Links

Activity

Hide
Helen Foster added a comment -

I made a note of all facilitator non-default permissions then reset the role to default. It made no difference to the problem.

The facilitator role now has teacher default permissions, apart from moodle/role:override set to allow. AFAIK no overrides are set.

Show
Helen Foster added a comment - I made a note of all facilitator non-default permissions then reset the role to default. It made no difference to the problem. The facilitator role now has teacher default permissions, apart from moodle/role:override set to allow. AFAIK no overrides are set.
Hide
Helen Foster added a comment -

Comments from Eloy:

I've traced down the problem to the course_allowed_module() function. Have to go now! But isn' it possible that the course_allowed_modules setting is not properly set in those courses?

The function preventing that to work is the course_allowed_module() function.

For sites having enabled the $course->restrictmodules setting, it does some extra things, like searching for allowed modules in the course_allowed_modules table.

That's all I can say now. Moodle.org is returning always false for teachers there.

Show
Helen Foster added a comment - Comments from Eloy: I've traced down the problem to the course_allowed_module() function. Have to go now! But isn' it possible that the course_allowed_modules setting is not properly set in those courses? The function preventing that to work is the course_allowed_module() function. For sites having enabled the $course->restrictmodules setting, it does some extra things, like searching for allowed modules in the course_allowed_modules table. That's all I can say now. Moodle.org is returning always false for teachers there.
Hide
Eloy Lafuente (stronk7) added a comment -

Some more research:

1) There is 3 configuration settings about restricting modules:

a) restrictmodulesfor: to disable or apply the restriction to all courses or just requested courses
b) restrictbydefault: something about new courses, not sure how it works.
c) defaultallowedmodules: the list of allowed modules

2) But the course_allowed_module(), if the $course->restrictmodules setting is enabled... goes straight to query the "course_allowed_modules" table, looking for allowed modules for a given course.

3) And, in moodle.org, that table only has a few records for one course, so the query always return FALSE for any module, so course_allowed_module() is preventing those menus to be displayed (in theory no module is available).

IMO, something is wrong because the course_allowed_modules table should be populated with a lot of records than now, that is clearly out of sync.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Some more research: 1) There is 3 configuration settings about restricting modules: a) restrictmodulesfor: to disable or apply the restriction to all courses or just requested courses b) restrictbydefault: something about new courses, not sure how it works. c) defaultallowedmodules: the list of allowed modules 2) But the course_allowed_module(), if the $course->restrictmodules setting is enabled... goes straight to query the "course_allowed_modules" table, looking for allowed modules for a given course. 3) And, in moodle.org, that table only has a few records for one course, so the query always return FALSE for any module, so course_allowed_module() is preventing those menus to be displayed (in theory no module is available). IMO, something is wrong because the course_allowed_modules table should be populated with a lot of records than now, that is clearly out of sync. Ciao
Hide
Nicolas Martignoni added a comment -

Confirming this in course "Moodle en français" too.

Show
Nicolas Martignoni added a comment - Confirming this in course "Moodle en français" too.
Hide
Helen Foster added a comment -

Fixed on moodle.org - thanks Martin!

Show
Helen Foster added a comment - Fixed on moodle.org - thanks Martin!
Hide
Nicolas Martignoni added a comment -

Verified. Fixed, thank you. Closing.

Show
Nicolas Martignoni added a comment - Verified. Fixed, thank you. Closing.

People

Dates

  • Created:
    Updated:
    Resolved: