mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
Merge branch 'MDL-38500-master' of git://github.com/FMCorz/moodle
This commit is contained in:
commit
1795fc7ead
@ -2853,8 +2853,9 @@ final class repository_instance_form extends moodleform {
|
||||
|
||||
$sql = "SELECT count('x')
|
||||
FROM {repository_instances} i, {repository} r
|
||||
WHERE r.type=:plugin AND r.id=i.typeid AND i.name=:name";
|
||||
if ($DB->count_records_sql($sql, array('name' => $data['name'], 'plugin' => $data['plugin'])) > 1) {
|
||||
WHERE r.type=:plugin AND r.id=i.typeid AND i.name=:name AND i.contextid=:contextid";
|
||||
$params = array('name' => $data['name'], 'plugin' => $this->plugin, 'contextid' => $this->contextid);
|
||||
if ($DB->count_records_sql($sql, $params) > 0) {
|
||||
$errors['name'] = get_string('erroruniquename', 'repository');
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user