UPGRADE-6.0.md
As the legacy builder was removed these JS libraries were removed as well:
composer phpstan when your plugin is installed to get the full list related to your plugin.Mautic\PointBundle\Form\Type\GenericPointSettingsType was removed. See https://github.com/mautic/mautic/pull/13904Mautic\ApiBundle\DependencyInjection\Factory\ApiFactory was removed.friendsofsymfony/oauth-server-bundle package was replaced with a maintained fork klapaudius/oauth-server-bundlelightsaml/sp-bundle package was replaced with a maintained fork javer/sp-bundleMautic\LeadBundle\Model\FieldModel::getUniqueIdentiferFields and Mautic\LeadBundle\Model\FieldModel::getUniqueIdentifierFields were removed. Use Mautic\LeadBundle\Field\FieldsWithUniqueIdentifier::getFieldsWithUniqueIdentifier instead.Mautic\PluginBundle\Integration\AbstractIntegration::__construct() had to be changed as the SessionInterface service no longer exists in Symfony 6. So it was removed from the constructor and session is being fetched from the RequestStack instead.Mautic\CoreBundle\Factory\MauticFactory::getRequest use dependency injection with RequestStack instead.Mautic\CoreBundle\Factory\MauticFactory::getDatabase use dependency injection instead.Mautic\CoreBundle\Factory\MauticFactory::getHelper use dependency injection instead.Mautic\CoreBundle\Factory\MauticFactory::getDebugMode use dependency injection instead.Mautic\CoreBundle\Factory\MauticFactory::getMauticBundles use BundleHelper instead.Mautic\CoreBundle\Factory\MauticFactory::getKernel use dependency injection instead.Mautic\CoreBundle\Factory\MauticFactory::getParameter use DI with the \Mautic\CoreBundle\Helper\CoreParametersHelper instead.Mautic\CoreBundle\Factory\MauticFactory::getVersion use dependency injection with KernelInterface, which will retrieve \AppKernel, then invoke getVersion() method.Mautic\CoreBundle\Factory\MauticFactory::getPluginBundles use BundleHelper instead.Mautic\CoreBundle\Factory\MauticFactory::getBundleConfig use BundleHelper instead.Mautic\CoreBundle\Factory\MauticFactory::getUser use UserHelper instead.Mautic\CoreBundle\Factory\MauticFactory::getSystemPath use PathsHelper instead.Mautic\CoreBundle\Factory\MauticFactory::getTranslator use Translator instead.Mautic\CoreBundle\Factory\MauticFactory::getRouter use Router or UrlGeneratorInterface instead.Mautic\CoreBundle\Factory\MauticFactory::getLocalConfigFile use dependency injection with KernelInterface, which will retrieve \AppKernel, then invoke getLocalConfigFile().Mautic\CoreBundle\Factory\MauticFactory::getEnvironment use dependency injection instead.Mautic\CoreBundle\Factory\MauticFactory::getIpAddress use IpLookupHelper instead.Mautic\CoreBundle\Factory\MauticFactory::getSecurity use dependency injection instead.Mautic\CoreBundle\Factory\MauticFactory::get use dependency injection instead.Mautic\CoreBundle\Factory\MauticFactory::serviceExists use dependency injection instead.Mautic\CoreBundle\Factory\MauticFactory::getSecurityContext use dependency injection instead.Mautic\CoreBundle\Factory\MauticFactory::getDispatcher use dependency injection instead.Mautic\CoreBundle\Factory\MauticFactory::getMailer use dependency injection instead with \Mautic\EmailBundle\Helper\MailHelper.Mautic\CoreBundle\Factory\MauticFactory::getIpAddressFromRequest use dependency injection with \Mautic\CoreBundle\Helper\IpLookupHelper instead.Mautic\CoreBundle\Factory\MauticFactory::getDate use \Mautic\CoreBundle\Helper\DateTimeHelper instead.Mautic\CoreBundle\Factory\MauticFactory::getLogger use dependency injection instead.Mautic\CoreBundle\Factory\MauticFactory::getTwig use DI with the \Twig\Environment instead.Mautic\CoreBundle\Factory\MauticFactory::getTheme use DI with the \Mautic\CoreBundle\Helper\ThemeHelper instead.Mautic\CoreBundle\Factory\MauticFactory::getInstalledThemes use DI with the \Mautic\CoreBundle\Helper\ThemeHelper instead.Mautic\CoreBundle\Factory\MauticFactory::getEntityManager use dependency injection instead.Mautic\CoreBundle\Factory\MauticFactory::getModel use dependency injection instead. Quick replacement will be Mautic\CoreBundle\Factory\ModelFactory::getModel, but most sustainable is to use dependency injection.Mautic\CoreBundle\Factory\MauticFactory, 'mautic.factory' service.Mautic\CampaignBundle\Entity::getEventsByChannel() as unused and buggy. No replacementMautic\CoreBundle\Test::createAnotherClient() as unused. No replacement.Mautic\NotificationBundle\Entity::getLeadStats() as unused and buggy. No replacmentMautic\WebhookBundle\Entity::removeOldLogs() as it was deprecated. Use removeLimitExceedLogs() instead.Mautic\PageBundle\Entity::findByIds() as unused and buggy. Use Doctrine's findAllBy(['id' => [1,2]]) instead.Mautic\PluginBundle\Controller::getIntegrationCampaignsAction() as unused and buggy together with JS function Mautic.getIntegrationCampaignsMautic\CoreBundle\Tests\Functional\Service::class as unused and testing 3rd party code instead of Mautic.Mautic\CoreBundle\Doctrine\TranslationMigrationTrait as unused and deprecated.Mautic\CoreBundle\Doctrine\VariantMigrationTrait as unused and deprecated.Mautic\IntegrationsBundle\Form\Type\NotBlankIfPublishedConstraintTrait as unused.Mautic\IntegrationsBundle\Form\Type\Auth\BasicAuthKeysTrait as unused.Mautic\IntegrationsBundle\Form\Type\Auth\Oauth1aTwoLeggedKeysTrait as unused.Mautic\CoreBundle\Helper\CoreParametersHelper::getParameter(). Use Mautic\CoreBundle\Helper\CoreParametersHelper::get() instead.mautic.user.form_guard_authenticator (Mautic\UserBundle\Security\Authenticator\FormAuthenticator::class)mautic.user.preauth_authenticator (Mautic\UserBundle\Security\Authenticator\PreAuthAuthenticator::class)mautic.security.authentication_listener (Mautic\UserBundle\Security\Firewall\AuthenticationListener::class)GrapesJsData class was moved from Mautic\InstallBundle\InstallFixtures\ORM namespace to MauticPlugin\GrapesJsBuilderBundle\InstallFixtures\ORM as plugins should not be coupled with core bundles.lightsaml/sp-bundle package was replaced with a maintained fork lightsaml2/sp-bundleMautic\PageBundle\Form\Type\PagePublishDatesType was removed.getSessionName was removed from Mautic\PageBundle\Helper\TrackingHelper No session for anonymous users. Use getCacheKey.getSession was removed from Mautic\PageBundle\Helper\TrackingHelper No session for anonymous users. Use getCacheItem.updateSession was removed from Mautic\PageBundle\Helper\TrackingHelper No session for anonymous users. Use updateCacheItem.getNewVsReturningPieChartData was removed from Mautic\PageBundle\Model\PageModel. Use getUniqueVsReturningPieChartData() instead.Mautic\PageBundle\Helper\PointActionHelper::validateUrlHit is no longer static.tightenco/collect:^8.16.0 package with illuminate/collections:^10.48.R&R instead of R&R)FormFieldHelper::getTypes signature has been changedFormFieldHelper::getFieldFilter signature has been changed and now returns string filter by defaultMeaning arrays cannot be returned with the get() method. Example of how to resolve it:
- $asset = $request->request->get('asset') ?? [];
+ $asset = $request->request->all()['asset'] ?? [];
- $q->orderBy($this->getTableAlias().'.dateAdded', \Doctrine\Common\Collections\Criteria::DESC);
+ $q->orderBy($this->getTableAlias().'.dateAdded', \Doctrine\Common\Collections\Order::Descending->value);
- $this->client->request(Request::METHOD_POST, '/s/ajax', $payload, [], $this->createAjaxHeaders());
+ $this->setCsrfHeader(); // this is necessary only for the /s/ajax endpoints. Other ajax requests do not need it.
+ $this->client->xmlHttpRequest(Request::METHOD_POST, '/s/ajax', $payload);
- $user = $this->loginUser('admin');
+ $user = $this->em->getRepository(User::class)->findOneBy(['username' => 'admin']);
+ $this->loginUser($user);
$this->client->request('GET', '/s/campaigns/new/');
- $response = $this->client->getResponse();
- Assert::assertTrue($response->isOk(), $response->getContent());
+ $this->assertResponseIsSuccessful();
Use Request to get the session instead.
- use Symfony\Component\HttpFoundation\Session\SessionInterface;
+ use Symfony\Component\HttpFoundation\RequestStack;
class NeedsSession
{
- public function __construct(private SessionInterface $session) {}
+ public function __construct(private RequestStack $requestStack) {}
public function doStuff()
{
- $selected = $this->session->get('mautic.category.type', 'category');
+ $selected = $this->requestStack->getSession()->get('mautic.category.type', 'category');
// ...
}
}
app/migrations/Version20230522141144.php has been removed. If you do not use the Mautic Citrix plugin or a fork of it, you can manually drop the plugin_citrix_events table from the database, as it is no longer used.