diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-02-12 15:31:59 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-02-12 15:31:59 +0000 |
| commit | 292de9017078600eee4ebf3a5cf8be14df498fc8 (patch) | |
| tree | df291d00567fedc867fd917e8e75f52c627b6721 | |
| parent | 2138dda81a7edfbd62c1dee108af20c589c882ee (diff) | |
sort and thus load core plugins first, fixes #5241
Closes #5241
Merge request studip/studip!3926
| -rw-r--r-- | lib/plugins/engine/PluginManager.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/plugins/engine/PluginManager.php b/lib/plugins/engine/PluginManager.php index 6177e00..4bcb96b 100644 --- a/lib/plugins/engine/PluginManager.php +++ b/lib/plugins/engine/PluginManager.php @@ -53,8 +53,16 @@ class PluginManager /** * Comparison function used to order plugins by position. */ - private static function positionCompare ($plugin1, $plugin2) + private static function positionCompare (array $plugin1, array $plugin2): int { + if ($plugin1['core'] && !$plugin2['core']) { + return -1; + } + + if (!$plugin1['core'] && $plugin2['core']) { + return 1; + } + return $plugin1['position'] - $plugin2['position']; } |
