Merge branch 'MDL-49379_master' of git://github.com/markn86/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2015-03-04 10:46:18 +01:00
+2 -2
View File
@@ -158,8 +158,8 @@ class external_service_form extends moodleform {
$errors = parent::validation($data, $files);
// Add field validation check for duplicate name.
if (!empty($data['name'])) {
if ($DB->record_exists('external_services', array('name' => $data['name']))) {
if ($webservice = $DB->get_record('external_services', array('name' => $data['name']))) {
if (empty($data['id']) || $webservice->id != $data['id']) {
$errors['name'] = get_string('nameexists', 'webservice');
}
}