public function FilebrowserUninstallValidator::validate in Filebrowser 3.x
Same name and namespace in other branches
- 8.2 src/FilebrowserUninstallValidator.php \Drupal\filebrowser\FilebrowserUninstallValidator::validate()
Determines the reasons a module can not be uninstalled.
Parameters
string $module: A module name.
Return value
string[] An array of reasons the module can not be uninstalled, empty if it can. Each reason should not end with any punctuation since multiple reasons can be displayed together.
Overrides ModuleUninstallValidatorInterface::validate
See also
template_preprocess_system_modules_uninstall()
File
- src/
FilebrowserUninstallValidator.php, line 41
Class
Namespace
Drupal\filebrowserCode
public function validate($module) {
$reasons = [];
if ($module == 'filebrowser') {
// The Filebrowser node type is provided by the Filebrowser module. Prevent uninstall
// if there are any nodes of that type.
if ($this
->hasNodes()) {
$reasons[] = $this
->t('To uninstall Filebrowser, delete all nodes of type %type', [
'%type' => 'dir_listing',
]);
}
}
return $reasons;
}