-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group Choice restore from Recycle Bin loses group settings #163
Comments
The issue comes from line 73 of mod/choicegroup/backup/moodle2/restore_choicegroup_stepslib.php: Expected behaviour for different scenarios would be:
Logically the restore process should:
The attached patch would apply this logic and fix the issue: choicegroup.patch.txt This fix might be considered a change to the behaviour of the activity, but the PHP error messages and the groupid=0 records in mdl_choicegroup_options make me lean towards classifying the behaviour as a bug. |
Thanks @ebithell for spotting this, working it out and sharing your fix. I completely agree with your logic and quickly tested your patch, which I have just integrated. This will be released along with the upcoming version officially supporting Moodle 4.0. |
Hello Nicolas, it seems that this problem is back. I am testing with moodle 3.9.18 + mod_choicegroup 1.38 (2022092202) and after restoring a course backup with mod_choicegroup with group selection set, the restored course shows the activity without the group selection of the original course (groups are being restored correctly at course level, but as ebithell said, the selected groups for the activity are not restored). The same is true in 1.37. Before we were using 1.33 with moodle 3.9.15 and it was fine. I hope you can check it out. Regards EDIT: Sorry, I think it was already reported here: #168 |
Hello, I have continued testing and I see that in the restored course, even though the selected groups field, in the activity settings, is empty, the student still sees as eligible the original groups and only the original ones and they can still make the selection. If the course had more groups not included in the original activity, they are not shown eligible in the restored activity. This is fine, however, in the settings, the selected groups field becomes empty and could be a problem or be confusing for the teacher. This behavior occurs both in choicegroup 1.38 with moodle 3.9.18 and moodle 3.11.11. Regards |
I would like to see this fixed |
Seen in Moodle 3.5.18 (mod_groupchoice version 1.15), 3.9.11 (version 1.33) and 3.11.6 (version 1.33).
When a Group Choice activity is restored from the Course Recycle Bin, the allocated Groups for the activity are not restored.
Steps to reproduce:
Expected result:
Actual result:
Notice: Undefined property: stdClass::$option in /var/www/moodle/mod/choicegroup/mod_form.php on line 218
Warning: Invalid argument supplied for foreach() in /var/www/moodle/mod/choicegroup/mod_form.php on line 218
Course backup & restore operate as expected but activity duplication also loses its groups setting, with the same PHP messages.
(description of cause and proposed solution with patch following in comments)
The text was updated successfully, but these errors were encountered: