From a2ecbe0e58bd026c48c36fd6c8663c2c673e4be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jer=C3=B4me=20Bakker?= Date: Fri, 3 Oct 2025 14:45:20 +0200 Subject: [PATCH 1/3] chore(notifications): rely on notification global language --- .../Discussions/Notifications/CreateDiscussionEventHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/discussions/classes/Elgg/Discussions/Notifications/CreateDiscussionEventHandler.php b/mod/discussions/classes/Elgg/Discussions/Notifications/CreateDiscussionEventHandler.php index 61081f68eb7..971abfb6444 100644 --- a/mod/discussions/classes/Elgg/Discussions/Notifications/CreateDiscussionEventHandler.php +++ b/mod/discussions/classes/Elgg/Discussions/Notifications/CreateDiscussionEventHandler.php @@ -34,7 +34,7 @@ protected function getNotificationBody(\ElggUser $recipient, string $method): st $entity?->getDisplayName(), $entity?->description, $entity?->getURL(), - ], $recipient->getLanguage()); + ]); } /** From b98d010e622bad237fbd338042710d1d88815538 Mon Sep 17 00:00:00 2001 From: Jeroen Dalsem Date: Tue, 7 Oct 2025 09:44:17 +0200 Subject: [PATCH 2/3] fixed(tests): correctly assert if route has required plugins --- .../Plugins/StaticConfigIntegrationTest.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/engine/tests/phpunit/plugins_integration/Elgg/Plugins/StaticConfigIntegrationTest.php b/engine/tests/phpunit/plugins_integration/Elgg/Plugins/StaticConfigIntegrationTest.php index 668e26c9c7b..a2d7b9c1a80 100644 --- a/engine/tests/phpunit/plugins_integration/Elgg/Plugins/StaticConfigIntegrationTest.php +++ b/engine/tests/phpunit/plugins_integration/Elgg/Plugins/StaticConfigIntegrationTest.php @@ -94,9 +94,24 @@ public function testRouteRegistrations(\ElggPlugin $plugin) { $view = "resources/{$conf['resource']}"; $this->assertTrue(elgg_view_exists($view), "Resource $view for route $name does not exist"); } - + + $required_plugins = (array) elgg_extract('required_plugins', $conf); + $validate_route = true; + foreach ($required_plugins as $plugin) { + if (!elgg_is_active_plugin($plugin)) { + $validate_route = false; + break; + } + } + elgg_register_route($name, $conf); - $this->assertInstanceOf(Route::class, _elgg_services()->routeCollection->get($name)); + + if ($validate_route) { + $this->assertInstanceOf(Route::class, _elgg_services()->routeCollection->get($name)); + } else { + $this->assertNull(_elgg_services()->routeCollection->get($name)); + } + elgg_unregister_route($name); } } From c8faaa71f800aa2b49212db85b7e74a4893cf5ae Mon Sep 17 00:00:00 2001 From: Jeroen Dalsem Date: Fri, 17 Oct 2025 12:03:50 +0200 Subject: [PATCH 3/3] fixed(log): need to set log level after config loaded from db --- engine/classes/Elgg/BootService.php | 9 +++++++++ engine/internal_services.php | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/engine/classes/Elgg/BootService.php b/engine/classes/Elgg/BootService.php index 1eba9b511bf..e779125b1d5 100644 --- a/engine/classes/Elgg/BootService.php +++ b/engine/classes/Elgg/BootService.php @@ -6,6 +6,7 @@ use Elgg\Di\InternalContainer; use Elgg\Exceptions\RuntimeException; use Elgg\Traits\Debug\Profilable; +use Psr\Log\LogLevel; /** * Boots Elgg and manages a cache of data needed during boot @@ -75,6 +76,14 @@ public function boot(InternalContainer $services) { $services->plugins->setBootPlugins($data->getActivePlugins(), false); + if (!Application::isCli()) { + // CLI log level is determined by CLI verbosity + // use value in settings.php if available + // database needs to be loaded into config to determine log level correctly + $debug = $config->getInitialValue('debug') ?? ($config->debug ?: LogLevel::CRITICAL); + $services->logger->setLevel($debug); + } + $services->views->configureFromCache(); } diff --git a/engine/internal_services.php b/engine/internal_services.php index 4893294fcc4..bc9f08e7858 100644 --- a/engine/internal_services.php +++ b/engine/internal_services.php @@ -87,9 +87,7 @@ break; } } else { - // use value in settings.php if available - $level = $c->config->getInitialValue('debug') ?? ($c->config->debug ?: LogLevel::CRITICAL); - $logger->setLevel($level); + $logger->setLevel($c->config->debug); } return $logger;