mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Prevent double module registration (#4804)
Co-authored-by: Lucas Bartholemy <luke-@users.noreply.github.com>
This commit is contained in:
parent
14c7fc5428
commit
286b2cc7b1
@ -6,6 +6,7 @@ HumHub Changelog
|
||||
- Fix #4792: Guest access to user profile home page
|
||||
- Fix #4794: CountrySelect profile field broken
|
||||
- Fix #4793: Form labels (HForm) are not displayed correctly
|
||||
- Fix #4569: Prevent double module registration
|
||||
- Fix #4389: Require to check a checkbox if the profile field is required
|
||||
|
||||
|
||||
|
@ -70,10 +70,17 @@ class ModuleAutoLoader implements BootstrapInterface
|
||||
}
|
||||
|
||||
$modules = [];
|
||||
$moduleIdFolders = [];
|
||||
foreach ($folders as $folder) {
|
||||
try {
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
$modules[$folder] = require $folder . DIRECTORY_SEPARATOR . self::CONFIGURATION_FILE;
|
||||
$moduleConfig = require $folder . DIRECTORY_SEPARATOR . self::CONFIGURATION_FILE;
|
||||
if (isset($moduleIdFolders[$moduleConfig['id']])) {
|
||||
Yii::error('Duplicated module "' . $moduleConfig['id'] . '"(' . $folder . ') is already loaded from the folder "' . $moduleIdFolders[$moduleConfig['id']] . '"');
|
||||
} else {
|
||||
$modules[$folder] = $moduleConfig;
|
||||
$moduleIdFolders[$moduleConfig['id']] = $folder;
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
Yii::error($e);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user