Commit 08f7826d authored by Hugh Davenport's avatar Hugh Davenport Committed by Gerrit Code Review
Browse files

Merge "Fix error about missing retainview in institution sharing"

parents 1665b419 de027f1f
......@@ -414,7 +414,7 @@ function editaccess_validate(Pieform $form, $values) {
$form->set_error('copyfornewgroups', get_string('viewscopiedfornewgroupsmustbecopyable', 'view'));
}
}
$retainview = $values['retainview'];
$retainview = isset($values['retainview']) ? $values['retainview'] : false;
if ($retainview && !$values['template']) {
$form->set_error('retainview', get_string('viewswithretainviewrightsmustbecopyable', 'view'));
}
......@@ -505,7 +505,7 @@ function editaccess_submit(Pieform $form, $values) {
'startdate' => $values['startdate'],
'stopdate' => $values['stopdate'],
'template' => (int) $values['template'],
'retainview' => (int) $values['retainview'],
'retainview' => isset($values['retainview']) ? (int) $values['retainview'] : 0,
'allowcomments' => (int) $values['allowcomments'],
'approvecomments' => (int) ($values['allowcomments'] && $values['approvecomments']),
'accesslist' => $values['accesslist'],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment