-
Bug
-
Resolution: Fixed
-
Minor
-
3.5.5
-
MOODLE_35_STABLE
-
MOODLE_36_STABLE, MOODLE_37_STABLE
-
MDL-65326-master -
We got a situation when some custom code broke backup files and particular capabilities in /course/roles.xml
Looking at the code it seems like there is TODO saying "it seems that assign_capability() doesn't check for valid capabilities at all ???"
If we look at the assign_capability method, it currently checks for that, and throws and exception.
This breaks restore process. I think, it's better to log a warning instead and let the backup process to complete.
Original Replication instructions:
- Create a course.
- Go to Course administration > Users > Permissions
- Pick one of the roles in Advanced role override
- Override mod/lesson:addinstance permission
- Backup the course and download the file.
- Uninstall mod_lesson and delete mod/lesson folder completely from the code base to make sure that the activity won't be reinstalled.
- Restore as a new course from the file you got on step 5
- Notice you get "Coding error detected, it must be fixed by a programmer: Capability 'mod/lesson:addinstance' was not found! This has to be fixed in code."