mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-49379 core_webservice: fixed ability to edit services
This commit is contained in:
parent
dba564c7db
commit
05536ad165
@ -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');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user