UPGRADE-4.0.md
Platform Requirements
API
Symfony 4
Important note about PHP vs Twig templates
Until recently, Symfony supported two templating engines: PHP and Twig. Mautic is pretty much exclusively built using the PHP templating engine. However, this engine was officially deprecated in Symfony 4.3 and has been removed in Symfony 5.
Starting with Mautic 4.3, we'd like new internal bundles as well as new plugins to be built in Twig. Mautic 4.3 introduces a working MauticCoreBundle:Default:content.html.twig alongside the already existing MauticCoreBundle:Default:content.html.php that can be extended by bundle or plugin authors.
Later on in the Mautic 4 development lifecycle, the aim will be to slowly migrate exiting bundles from the PHP templating engine over to Twig. The good thing is that both engines can co-exist until we upgrade to Symfony 5 at some point in the future, so we can migrate bundles and plugins one by one.
Packages removed
mautic.http.connector below)Packages updated
Commands
Services
mautic.http.client has been upgraded from GuzzleHttp 6 to 7. You can now leverage Psr\Http\Client\ClientInterface (PSR-18) or GuzzleHttp\Client (more convenience methods) in your class constructors! Example:config.php:
'mautic.demo.class' => [
'class' => DemoClass::class,
'arguments' => [
'mautic.http.client',
],
],
DemoClass.php
use Psr\Http\Client\ClientInterface;
....
public function __construct(
ClientInterface $client
) {
$this->client = $client;
}
mautic.http.connector has been removed in favor of mautic.http.client. See the example above on how to use it in your class constructors.IntegrationsBundle
IntegrationEvents::INTEGRATION_CONFIG_BEFORE_SAVE event was moved to a slightly later point in time. Thanks to this change, plugin developers can actually get the updated values that were submitted by the user. This way, listeners can modify values before persisting them to the database. This brings the functionality in line with ConfigEvents::CONFIG_PRE_SAVE.PluginBundle
AbstractIntegration and use the method makeRequest, including $options['return_raw'], you will now get \Psr\Http\Message\ResponseInterface as the response type (was \Joomla\CMS\Http\Response)Mautic\PluginBundle\PluginEvents::PLUGIN_ON_INTEGRATION_RESPONSE event, PluginIntegrationRequestEvent->getResponse() now returns \Psr\Http\Message\ResponseInterface as the type (was not explicitly defined)WebhookBundle
Support for unique fields for companies
Misc
\Mautic\CoreBundle\Doctrine\Provider\VersionProvider has been removed as it's no longer necessary.