diff options
author | Robin Appelman <robin@icewind.nl> | 2023-08-15 12:11:08 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2023-08-17 10:57:56 +0200 |
commit | 37e3115cb472a8d8b16be183c045220835e1fbef (patch) | |
tree | 454ec30c846f1f44be711789ef75cb94a1a455b1 | |
parent | ccf57e0715d81b8d14f01d5e4d21d5962e0e2f8a (diff) | |
download | nextcloud-server-37e3115cb472a8d8b16be183c045220835e1fbef.tar.gz nextcloud-server-37e3115cb472a8d8b16be183c045220835e1fbef.zip |
don't always add core/common and core/main during "sorting"
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | core/Listener/BeforeTemplateRenderedListener.php | 6 | ||||
-rw-r--r-- | lib/public/Util.php | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/core/Listener/BeforeTemplateRenderedListener.php b/core/Listener/BeforeTemplateRenderedListener.php index c453d010a4c..95adfc61ad9 100644 --- a/core/Listener/BeforeTemplateRenderedListener.php +++ b/core/Listener/BeforeTemplateRenderedListener.php @@ -49,6 +49,12 @@ class BeforeTemplateRenderedListener implements IEventListener { \OC_Util::addStyle('server', null, true); + if ($event instanceof BeforeLoginTemplateRenderedEvent) { + // todo: make login work without these + Util::addScript('core', 'common'); + Util::addScript('core', 'main'); + } + if ($event instanceof BeforeTemplateRenderedEvent) { // include common nextcloud webpack bundle Util::addScript('core', 'common'); diff --git a/lib/public/Util.php b/lib/public/Util.php index 63ed9e835c7..1d03c35a9b7 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -212,7 +212,12 @@ class Util { $sortedScripts = $sortedScripts ? array_merge(...array_values(($sortedScripts))) : []; // Override core-common and core-main order - array_unshift($sortedScripts, 'core/js/common', 'core/js/main'); + if (in_array('core/js/main', $sortedScripts)) { + array_unshift($sortedScripts, 'core/js/main'); + } + if (in_array('core/js/common', $sortedScripts)) { + array_unshift($sortedScripts, 'core/js/common'); + } return array_unique($sortedScripts); } |