Closed hikashop-nicolas closed 11 months ago
I started to look into it, but I'm not sure what the problem is. I can see that the createMailer function has been changed with Joomla 4.4.0 and that it is now deprecated and due to be removed in Joomla 6. But I don't see why that error would happen. The callstack points, it seems to me, at some kind of incompatibility between the createMailer function of Factory in JROOT/libraries/src/Factory.php and the createMailer function of MailerFactory in JROOT/libraries/src/Mail/MailerFactory.php
Also 'Send Test Mail' fails:
#
2023-10-19T06:43:38+00:00 CRITICAL 2003:fe:4705:9d0b:a450:7dd4:404d:cf66 error Uncaught Throwable of type TypeError thrown with message "Joomla\CMS\Mail\MailerFactory::createMailer(): Return value must be of type Joomla\CMS\Mail\MailerInterface, Joomla\CMS\Mail\Mail returned". Stack trace: #0 [ROOT]/administrator/components/com_config/src/Model/ApplicationModel.php(1201): Joomla\CMS\Mail\MailerFactory->createMailer()
Which mailer are you using?
PHP-Mail
I have a feeling this is caused by a 3rd party plugin overriding the Joomla! Mail class (had it happen before, but now with type hinting it could lead to this error)
$mailer = new Mail((bool) $configuration->get('throw_exceptions', true));
add these lines
$reflection = new \ReflectionClass($mailer);
var_dump($reflection->getName());
var_dump($reflection->getFilename());
die;
Take a look at the browser console - open the XHR request and show us the response.
Great, thank you!!!
I've disabled the plugin "AcyMailing - Override Joomla emails" and now everything works fine again!
closing as it is not from core
Steps to reproduce the issue
Not sure
Expected result
Mail instance is returned
Actual result
Error "Joomla\CMS\Mail\MailerFactory::createMailer(): Return value must be of type Joomla\CMS\Mail\MailerInterface, Joomla\CMS\Mail\Mail returned" happens
System information (as much as possible)
Joomla 4.4.0
Additional comments
This has been reported on several pages: https://www.hikashop.com/forum/install-update/907149-problems-after-joomla-4-4-upgrade.html#355958 https://forum.joomla.org/viewtopic.php?f=812&p=3704289 https://joomla.stackexchange.com/questions/33416/error-when-upgrading-from-4-3-4-5o-4-4-error-meesage https://forum.joomla.org/viewtopic.php?f=808&p=3704236
Example of callstack:
Function Location
1 () JROOT/libraries/src/Mail/MailerFactory.php:106 2 Joomla\CMS\Mail\MailerFactory->createMailer() JROOT/libraries/src/Factory.php:708 3 Joomla\CMS\Factory::createMailer() JROOT/libraries/src/Factory.php:490 4 Joomla\CMS\Factory::getMailer() JROOT/components/com_hikashop/controllers/product.php:257 5 productController->add_waitlist() JROOT/libraries/src/MVC/Controller/BaseController.php:693 6 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_hikashop/helpers/helper.php:2535 7 hikashopController->execute() JROOT/components/com_hikashop/hikashop.php:88 8 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71 9 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73 10 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361 11 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:208 12 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:249 13 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293 14 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:61 15 require_once() JROOT/index.php:32