Update from 4.4.0 to 5.0.0 with many plugins and based on T4 blank template.
Patch below has fixed the issue on 3 server instances.
Website functional.
Website failure
Joomla\CMS\Event\Module\ModuleListEvent::onSetModules(): Argument #1 ($value) must be of type array, null given, called in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Event/AbstractEvent.php on line 225
Linux based shared web-service
Backtrace:
TypeError in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Event/Module/ModuleListEvent.php (line 73)
ModuleListEvent->onSetModules(null) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Event/AbstractEvent.php (line 225)
AbstractEvent->setArgument('modules', null) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Event/AbstractEvent.php (line 115)
AbstractEvent->__construct('onPrepareModuleList', array('modules' => null, 'subject' => null)) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Event/AbstractImmutableEvent.php (line 51)
AbstractImmutableEvent->__construct('onPrepareModuleList', array('modules' => null, 'subject' => null)) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Event/Module/ModuleEvent.php (line 55)
ModuleEvent->__construct('onPrepareModuleList', array('modules' => null, 'subject' => null)) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Event/Module/ModuleListEvent.php (line 48)
ModuleListEvent->__construct('onPrepareModuleList', array(null)) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Application/EventAware.php (line 106)
WebApplication->triggerEvent('onPrepareModuleList', array(null)) in /hp/cn/aa/rl/www/kgs-dhs/administrator/cache/t4core/ModuleHelper.php (line 369)
_JModuleHelper::load() in /hp/cn/aa/rl/www/kgs-dhs/administrator/cache/t4core/ModuleHelper.php (line 88)
_JModuleHelper::getModules('debug') in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Document/Renderer/Html/ModulesRenderer.php (line 50)
ModulesRenderer->render('debug', array('style' => 'none'), null) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Document/HtmlDocument.php (line 575)
HtmlDocument->getBuffer('modules', 'debug', array('style' => 'none')) in /hp/cn/aa/rl/www/kgs-dhs/templates/t4_bs5_blank/error.php (line 95)
require('/hp/cn/aa/rl/www/kgs-dhs/templates/t4_bs5_blank/error.php') in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Document/HtmlDocument.php (line 731)
HtmlDocument->_loadTemplate('/hp/cn/aa/rl/www/kgs-dhs/templates/t4_bs5_blank', 'error.php') in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Document/HtmlDocument.php (line 785)
HtmlDocument->_fetchTemplate(array('template' => 't4_bs5_blank', 'directory' => '/hp/cn/aa/rl/www/kgs-dhs/templates', 'debug' => false, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php')) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Document/HtmlDocument.php (line 622)
HtmlDocument->parse(array('template' => 't4_bs5_blank', 'directory' => '/hp/cn/aa/rl/www/kgs-dhs/templates', 'debug' => false, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php')) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Document/HtmlDocument.php (line 640)
HtmlDocument->render(false, array('template' => 't4_bs5_blank', 'directory' => '/hp/cn/aa/rl/www/kgs-dhs/templates', 'debug' => false, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php')) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Document/ErrorDocument.php (line 139)
ErrorDocument->render(false, array('template' => 't4_bs5_blank', 'directory' => '/hp/cn/aa/rl/www/kgs-dhs/templates', 'debug' => false, 'csp_nonce' => null, 'templateInherits' => '', 'params' => object(Registry), 'file' => 'error.php')) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Error/Renderer/HtmlRenderer.php (line 70)
HtmlRenderer->render(object(TypeError)) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Exception/ExceptionHandler.php (line 136)
ExceptionHandler::render(object(TypeError)) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Exception/ExceptionHandler.php (line 73)
ExceptionHandler::handleException(object(TypeError)) in /hp/cn/aa/rl/www/kgs-dhs/libraries/src/Application/CMSApplication.php (line 336)
CMSApplication->execute() in /hp/cn/aa/rl/www/kgs-dhs/includes/app.php (line 58)
require_once('/hp/cn/aa/rl/www/kgs-dhs/includes/app.php') in /hp/cn/aa/rl/www/kgs-dhs/index.php (line 32)
Patch:
--- AbstractEvent.php.orig 2023-10-21 17:41:06.314834698 +0200
+++ AbstractEvent.php 2023-10-21 17:36:54.281547361 +0200
@@ -221,7 +221,7 @@
$methodName1 = 'onSet' . $ucfirst;
$methodName2 = 'set' . $ucfirst;
- if (method_exists($this, $methodName1)) {
+ if (method_exists($this, $methodName1) && ($value != null)) {
$value = $this->{$methodName1}($value);
} elseif (method_exists($this, $methodName2)) {
@trigger_error(
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
The event onPrepareModuleList
accept only array now. The proposed changes is incorect.
It kind of the same to #42149
As I see from the trace the extension is overriding core ModuleHelper _JModuleHelper::load() in /hp/cn/aa/rl/www/kgs-dhs/administrator/cache/t4core/ModuleHelper.php
. Because of it I would call not a core issue.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-10-21 19:25:02 |
Closed_By | ⇒ | richard67 |
Thank you for the analysis of this issue. I'll open a ticket against t4core ...
Ping @Fedik : Could you check this issue and the proposed code change? It seems it's related to the event changes in 5.0.