Commit 30d45382 authored by Nigel McNie's avatar Nigel McNie

Stop the institution form crashing when saving it. Fixes #1870.

parent 8b7243af
...@@ -251,7 +251,7 @@ else { ...@@ -251,7 +251,7 @@ else {
} }
function institution_validate(Pieform $form, $values) { function institution_validate(Pieform $form, $values) {
if (!$form->get_error('name') && record_exists('institution', 'name', $values['name'])) { if (!empty($values['name']) && !$form->get_error('name') && record_exists('institution', 'name', $values['name'])) {
$form->set_error('name', get_string('institutionnamealreadytaken', 'admin')); $form->set_error('name', get_string('institutionnamealreadytaken', 'admin'));
} }
} }
......
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