Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-38500-24' of git://github.com/FMCorz/moodle into MO…

…ODLE_24_STABLE
  • Loading branch information...
commit b15eea60090264ac12b7869f69086c8e88481e43 2 parents 1df3b0a + 7b6ed67
@danpoltawski danpoltawski authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 repository/lib.php
View
5 repository/lib.php
@@ -2698,8 +2698,9 @@ public function validation($data, $files) {
$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');
}
Please sign in to comment.
Something went wrong with that request. Please try again.