Skip to content

Commit

Permalink
Merge branch 'MDL-38500-24' of git://github.com/FMCorz/moodle into MO…
Browse files Browse the repository at this point in the history
…ODLE_24_STABLE
  • Loading branch information
danpoltawski committed May 7, 2013
2 parents 1df3b0a + 7b6ed67 commit b15eea6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions repository/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit b15eea6

Please sign in to comment.