Switch role to does not seem to work

Switch role to does not seem to work

by Tim Hunt -
Number of replies: 6
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I think it doesn't anyway, but I am not sure which is why I am posting here.

To investigate MDL-6739 I had to log out and log in, I could not do it all logged in as admin, and using the switch role interface.

Also, you can't backup role definitions, or at least if one can, I can't see how.

There are notices if you try to restore the attached file. (Map the two custom roles to teacher.)

Also, it would be really really helpful if you could create roles starting by copying an existing role like teacher, then changing a few options, rather than having to tick a lot of boxes yourself.
Average of ratings: -
In reply to Tim Hunt

Re: Switch role to does not seem to work

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hmm, there could be some regression for the case of an admin (it used to work!)

Gee I wish there was a bug filed for it in the tracker.  wink
In reply to Tim Hunt

Re: Switch role to does not seem to work

by Robert Brenstein -
I wonder whether roles could not be handled as plugins of the sort like quiz question types. That would allow to backup easier, swap roles between sites, and duplicate for minor modifications.
In reply to Robert Brenstein

Re: Switch role to does not seem to work

by Chardelle Busch -
Picture of Core developers
Not only is there a problem with backing up role assignments, I think there is a general problem with role assignments not updating in the db.  E.g., if I assign a role as teacher of a course, then "unassign" that role, then later when logging in I get error messages and have to manually delete the old role assignment from the db.
In reply to Tim Hunt

Re: Switch role to does not seem to work

by Yu Zhang -
Hi Tim,

Roles definitions are always backed up in the backup file (moodle.xml). I also did not get any warnings when restoring the backupfile you provided, maybe you are using an older version?

Yu
In reply to Yu Zhang

Re: Switch role to does not seem to work

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Oh I see, they are in the XML, but I had no way of knowing that till you told me, and they don't seems to be restored.

It would be very useful to be able to just backup the definition of a single role, then restore it to another site.
In reply to Tim Hunt

Re: Switch role to does not seem to work

by Yu Zhang -
Hi Tim,

The role definitions are only restored if they are actually used in the course (someone having a role assignement in the course, activities, blocks etc). So in normal situations roles such as admin or course creators are unlikely to be restored.
Just filed MDL-7392 for you. Should be able to get it in for 1.7.1 tongueout

Cheers,

Yu