Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-29218 Repository: Hide the repo if repository::plugin_init return…

…s false
  • Loading branch information...
commit fd0608a2266f6d9c53d169c2dfd9cf647ac13cbf 1 parent 0bd9f00
@scara scara authored
Showing with 4 additions and 1 deletion.
  1. +3 −1 admin/repository.php
  2. +1 −0  repository/lib.php
View
4 admin/repository.php
@@ -143,8 +143,10 @@ function repository_action_url($repository) {
$success = $repositorytype->update_options($settings);
} else {
$type = new repository_type($plugin, (array)$fromform, $visible);
- $type->create();
$success = true;
+ if (!$repoid = $type->create()) {
+ $success = false;
+ }
$data = data_submitted();
}
if ($success) {
View
1  repository/lib.php
@@ -255,6 +255,7 @@ public function create($silent = false) {
}
//run plugin_init function
if (!repository::static_function($this->_typename, 'plugin_init')) {
+ $this->update_visibility(false);
if (!$silent) {
throw new repository_exception('cannotinitplugin', 'repository');
}
Please sign in to comment.
Something went wrong with that request. Please try again.