Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.7, 3.11
Description
When a group gets created automatically the form might include or not the field 'enablemessaging' depending on the ability of the user to create group conversations:
File: group/autogroup_form.php
// Enable group messaging for the groups to be auto-created.
|
if (\core_message\api::can_create_group_conversation($USER->id, $coursecontext)) { |
$mform->addElement('selectyesno', 'enablemessaging', get_string('enablemessaging', 'group')); |
$mform->addHelpButton('enablemessaging', 'enablemessaging', 'group'); |
}
|
If the field does not get included in the form, upon processing we get a Notice, since the property $data->enablemessaging does not exist:
File: group/autogroup.php
$newgroup->enablemessaging = $data->enablemessaging;
|
The first solution I found was to include in the config.php:
$CFG->messaging = 1; |
Now, I tested and consider that a better Canonical solution is:
- Modify the file group/autogroup.php replacing the line mentioned before by:
$newgroup->enablemessaging = $data->enablemessaging ?? 0; |
In this fashion we do not have to alter the config.php!
Any comments or suggestions?
Related issue: MDL-63620
Attachments
Issue Links
- is duplicated by
-
MDL-66904 Error messages occur when creating random groups.
-
- Closed
-