Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…s false
  • Loading branch information...
commit d0ddf08dc03614af5e9737a9582d3d693d44a89a 1 parent 6cef890
@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
@@ -140,8 +140,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.