Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5629: Better handling of legacy configuration file options for d… #6938

Merged
merged 4 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG-DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ HumHub Changelog
- Fix #6931: Fix visibility of private spaces in the user notification settings
- Enh #6757: Allow changing visibility of global content
- Fix #5419: Lock search index while reindexing
- Fix #5629: Better handling of legacy configuration file options for disabled non-core modules

1.16.0-beta.1 (April 5, 2024)
-----------------------------
Expand Down
12 changes: 12 additions & 0 deletions protected/humhub/components/ModuleManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ public function register(string $basePath, ?array $config = null)
$isCoreModule = (isset($config['isCoreModule']) && $config['isCoreModule']);
$isInstallerModule = (isset($config['isInstallerModule']) && $config['isInstallerModule']);

if (
!$isCoreModule
&& !$isInstallerModule
&& !empty(Yii::$app->loadedAppConfig['modules'][$config['id']])
&& !in_array($config['id'], $this->enabledModules, true)
) {
$errorMessage = Yii::t('error', 'The module {moduleId} is present in the HumHub configuration file even though this module is disabled. Please remove it from the configuration.', ['moduleId' => '“' . $config['id'] . '”']);
Yii::error($errorMessage);
Yii::$app->view?->error($errorMessage);
return null;
}

$this->modules[$config['id']] = $config['class'];

if (isset($config['namespace'])) {
Expand Down