Fix uninstall module with not writable module path (#5734)

* Fix uninstall module

* Update CHANGELOG.md (#5734)

* Update CHANGELOG.md

Co-authored-by: Lucas Bartholemy <luke-@users.noreply.github.com>
This commit is contained in:
Yuriy Bakhtin 2022-06-02 14:12:12 +03:00 committed by GitHub
parent 34c5ab5dec
commit 5aacfeb6d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,10 @@
HumHub Changelog
================
1.11.3 (Unreleased)
---------------------
- Fix #5734: Fix error message when uninstall module and module folder is not writable
1.11.2 (May 30, 2022)
---------------------
- Fix: #5652: Fix undefined UrlOembed provider pattern

View File

@ -140,7 +140,7 @@ class ModuleController extends Controller
$moduleId = Yii::$app->request->get('moduleId');
if (Yii::$app->moduleManager->hasModule($moduleId) && Yii::$app->moduleManager->canRemoveModule($moduleId)) {
/* @var Module $module */
$module = Yii::$app->moduleManager->getModule($moduleId);
if ($module == null) {
@ -148,7 +148,7 @@ class ModuleController extends Controller
}
if (!is_writable($module->getBasePath())) {
throw new HttpException(500, Yii::t('AdminModule.modules', 'Module path %path% is not writeable!', ['%path%' => $module->getPath()]));
throw new HttpException(500, Yii::t('AdminModule.modules', 'Module path %path% is not writeable!', ['%path%' => $module->getBasePath()]));
}
Yii::$app->moduleManager->removeModule($module->id);