mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-30764 Activity settings: do not disable grouping dropdown if it is already set
This commit is contained in:
parent
acb3bf8ac1
commit
782b21dc0f
1 changed files with 13 additions and 8 deletions
|
@ -173,6 +173,10 @@ abstract class moodleform_mod extends moodleform {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't disable/remove groupingid if it is currently set to something,
|
||||||
|
// otherwise you cannot turn it off at same time as turning off other
|
||||||
|
// option (MDL-30764)
|
||||||
|
if (empty($this->_cm) || !$this->_cm->groupingid) {
|
||||||
if ($mform->elementExists('groupmode') and !$mform->elementExists('groupmembersonly') and empty($COURSE->groupmodeforce)) {
|
if ($mform->elementExists('groupmode') and !$mform->elementExists('groupmembersonly') and empty($COURSE->groupmodeforce)) {
|
||||||
$mform->disabledIf('groupingid', 'groupmode', 'eq', NOGROUPS);
|
$mform->disabledIf('groupingid', 'groupmode', 'eq', NOGROUPS);
|
||||||
|
|
||||||
|
@ -185,6 +189,7 @@ abstract class moodleform_mod extends moodleform {
|
||||||
$mform->removeElement('groupingid');
|
$mform->removeElement('groupingid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Completion: If necessary, freeze fields
|
// Completion: If necessary, freeze fields
|
||||||
$completion = new completion_info($COURSE);
|
$completion = new completion_info($COURSE);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue