Switch role to does not seem to work

Switch role to does not seem to work

Tim Hunt -
回帖数:6
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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.
回复Tim Hunt

Re: Switch role to does not seem to work

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 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.  眨眼
回复Tim Hunt

Re: Switch role to does not seem to work

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.
回复Robert Brenstein

Re: Switch role to does not seem to work

Chardelle Busch -
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.
回复Tim Hunt

Re: Switch role to does not seem to work

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
回复Yu Zhang

Re: Switch role to does not seem to work

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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.
回复Tim Hunt

Re: Switch role to does not seem to work

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