File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,10 @@ public function setupThemePlugin(array $themes): void
251251 $ path = [];
252252 foreach ($ themes as $ theme ) {
253253 $ pluginsPath = CorePlugin::path ($ theme ) . 'plugins ' . DS ;
254+ // path() を実行するとプラグインクラスがコレクションに登録されてしまう
255+ // ここで登録されてしまうと、対象プラグインの bootstrap() が正常に実行されないため
256+ // ここでは一旦削除する。
257+ CorePlugin::getCollection ()->remove ($ theme );
254258 if (!is_dir ($ pluginsPath )) continue ;
255259 $ path [] = $ pluginsPath ;
256260 }
@@ -280,7 +284,16 @@ public function getAvailableThemes(): array
280284 $ themes = [];
281285 foreach ($ sites as $ site ) {
282286 if ($ site ->theme ) {
283- if (!CorePlugin::isLoaded ($ site ->theme ) && !is_dir (CorePlugin::path ($ site ->theme ))) continue ;
287+ if (!CorePlugin::isLoaded ($ site ->theme )) {
288+ $ pluginPath = CorePlugin::path ($ site ->theme );
289+ // path() を実行するとプラグインクラスがコレクションに登録されてしまう
290+ // ここで登録されてしまうと、対象プラグインの bootstrap() が正常に実行されないため
291+ // ここでは一旦削除する。
292+ CorePlugin::getCollection ()->remove ($ site ->theme );
293+ if (!is_dir ($ pluginPath )) {
294+ continue ;
295+ }
296+ }
284297 if (in_array ($ site ->theme , $ themes )) continue ;
285298 $ themes [] = $ site ->theme ;
286299 }
You can’t perform that action at this time.
0 commit comments