Forwarding to "Assign roles" page instead of "participansts list"

Forwarding to "Assign roles" page instead of "participansts list"

by Peteris Rudzajs -
Number of replies: 2
Greetings!
I have strange situation - when I click in the participants block to see the course users, I'm directed to "Assign roles" page.
This situation could be normal, if I would not have any role assignments in course, but at the moment there are role assignmets!!! (see attached image)

I have checked database table mdl_role_assignments --> there all seems to be ok- records for context,userid,rolid exists for every course!

(this problem is in ALL courses!)

Can't figure it out, why it is so! Please help!

Tnx!
Attachment instead_of_participants.PNG
Average of ratings: -
In reply to Peteris Rudzajs

Re: Forwarding to "Assign roles" page instead of "participansts list"

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That redirect is made when there are no roles assigned at all in the course. On the face of it, that appears not to be the case.

Two things... I would run with Debugging switched on to see if any errors or notices appear. Also consider if you have changed anything to do with roles. Have you assigned your roles in the "normal" manner within the course or are they assigned at context/site level? Anything out of the ordinary at all really.

Also, the roles check is based on the moodle/course:view capability. So if anything has happened to that you would have a problem - however, without that users can't see the course!
Average of ratings:Useful (1)
In reply to Howard Miller

Re: Forwarding to "Assign roles" page instead of "participansts list"

by Peteris Rudzajs -
Thanks, Howard, for answer.
What I did and what were the results:
1. Turned on "DEVELOPER: extra Moodle debug messages for developers" and set debugdisplay to YES --> no errors, no warnings, nothing unusual
2. With the moodle/course:view capability all is ok --> for the necessary roles this capability was set up
3. Then I considered what I have done with roles in general. This is the right question!
Deeper situation description: we have implemented role capability "moodle/course:enrolled" (http://tracker.moodle.org/browse/MDL-11798) in our Moodle. To implement this capability, local changes to database should be done. After setup this capapility all was ok and worked as expected.
Problems started after Moodle update from Moodle 1.9.5+ (Build: 20090902) to Moodle 1.9.5+ (Build: 20091007). During this update changes to database was done and as a result capability "moodle/course:enrolled" was lost.
The problem of forwarding from "Participants view" to "Assign roles" view was because of missing this capability. When restored all went ok!

But there is an open question. How to ensure that after database update the locally added capabilities remain?