Skip to content

Commit

Permalink
Merge branch 'MDL-64764' of git://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Jan 8, 2020
2 parents f28fab4 + 95dfd8e commit 52aa532
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions admin/roles/classes/define_role_table_advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,19 @@ public function read_submitted_permissions() {
// Allowed roles.
$allow = optional_param_array('allowassign', null, PARAM_INT);
if (!is_null($allow)) {
$this->allowassign = $allow;
$this->allowassign = array_filter($allow);
}
$allow = optional_param_array('allowoverride', null, PARAM_INT);
if (!is_null($allow)) {
$this->allowoverride = $allow;
$this->allowoverride = array_filter($allow);
}
$allow = optional_param_array('allowswitch', null, PARAM_INT);
if (!is_null($allow)) {
$this->allowswitch = $allow;
$this->allowswitch = array_filter($allow);
}
$allow = optional_param_array('allowview', null, PARAM_INT);
if (!is_null($allow)) {
$this->allowview = $allow;
$this->allowview = array_filter($allow);
}

// Now read the permissions for each capability.
Expand Down Expand Up @@ -619,7 +619,9 @@ protected function get_allow_role_control($type) {
if ($this->roleid == 0) {
$options[-1] = get_string('thisnewrole', 'core_role');
}
return html_writer::select($options, 'allow'.$type.'[]', $selected, false, array('multiple' => 'multiple',
return
html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'allow'.$type.'[]', 'value' => "")) .
html_writer::select($options, 'allow'.$type.'[]', $selected, false, array('multiple' => 'multiple',
'size' => 10, 'class' => 'form-control'));
}

Expand Down

0 comments on commit 52aa532

Please sign in to comment.