-
Bug
-
Resolution: Duplicate
-
Critical
-
None
-
3.9.1, 3.10, 4.0
-
MOODLE_310_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
-
MDL-69508-master -
If you don't have the permissions to backup userdata the course copy ui prints an error.
Steps to reproduce
- Go to edit the role "Manager" and unset the permissions "moodle/backup:userinfo" and "moodle/restore:userinfo".
- Assign a user to this role in a course category context.
- Login as the manager.
- Go into a course inside the category where this user is assigned as manager.
- Choose from the course menu the item "Copy course".
- Notice: there is no checkbox to include userdata!
- Fill out all form elements and click on the button "Copy and view"
- You get an error message "error/copy_class_field_not_found".
The reason for this error is the missing value "userdata" which is not defined in the moodleform if the capability are not sufficiant.
If you add a hidden field in this case the error message is not showing up anymore but now the adhoc task stucks with the error "error/setting_locked_by_permission".
This happens because the asynchronous_copy_task tries to set the value "0" to the backup_setting "user" which is not allowed.
If you change the code in the asynchronous_copy_task in the way that the value "1" is set if $copyinfo->userdata is true, then the copy task runs to the end.
- duplicates
-
MDL-69448 Course Copy in 3.9 and 3.9.1 not working for teacher with extended permissions
-
- Closed
-