From 94aa53987ff7e4c5cefff18e2f2ad8c559fedecb Mon Sep 17 00:00:00 2001 From: Ingolf Steinardt Date: Thu, 8 Aug 2024 08:39:15 +0200 Subject: [PATCH 1/2] Fix deprecations and session --- .../DcGeneral/Table/RenderSettings/JumpToListener.php | 4 ++++ src/CoreBundle/Resources/config/services.yml | 2 +- src/Events/DatabaseBackedListener.php | 10 +++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/CoreBundle/EventListener/DcGeneral/Table/RenderSettings/JumpToListener.php b/src/CoreBundle/EventListener/DcGeneral/Table/RenderSettings/JumpToListener.php index 34401887b..79ec518f7 100644 --- a/src/CoreBundle/EventListener/DcGeneral/Table/RenderSettings/JumpToListener.php +++ b/src/CoreBundle/EventListener/DcGeneral/Table/RenderSettings/JumpToListener.php @@ -39,8 +39,10 @@ */ class JumpToListener extends AbstractAbstainingListener { + /** @psalm-suppress MissingClassConstType */ private const DEFAULT_TYPE = UrlGeneratorInterface::ABSOLUTE_PATH; + /** @psalm-suppress MissingClassConstType */ private const TYPE_MAP = [ 'absolute_url' => UrlGeneratorInterface::ABSOLUTE_URL, 'absolute_path' => UrlGeneratorInterface::ABSOLUTE_PATH, @@ -48,6 +50,8 @@ class JumpToListener extends AbstractAbstainingListener 'network_path' => UrlGeneratorInterface::NETWORK_PATH, ]; + /** @psalm-suppress MissingClassConstType */ + private const TYPE_MAP_INVERSE = [ UrlGeneratorInterface::ABSOLUTE_URL => 'absolute_url', UrlGeneratorInterface::ABSOLUTE_PATH => 'absolute_path', diff --git a/src/CoreBundle/Resources/config/services.yml b/src/CoreBundle/Resources/config/services.yml index e66fdbccb..37162dcb5 100644 --- a/src/CoreBundle/Resources/config/services.yml +++ b/src/CoreBundle/Resources/config/services.yml @@ -192,7 +192,7 @@ services: MetaModels\MetaModelsServiceContainer: deprecated: package: metamodels/core - version: 2.3 + version: 2.2 message: 'The service "%service_id%" is deprecated and to be removed in MetaModels 3 - inject needed services directly.' configurator: ['@MetaModels\CoreBundle\LegacyCompat\ServiceContainerInitializer', 'configure'] public: true diff --git a/src/Events/DatabaseBackedListener.php b/src/Events/DatabaseBackedListener.php index 175ffd8ad..dfc2bd562 100644 --- a/src/Events/DatabaseBackedListener.php +++ b/src/Events/DatabaseBackedListener.php @@ -248,9 +248,12 @@ protected function createInstance(CreateMetaModelEvent $event, $arrData) */ public function createMetaModel(CreateMetaModelEvent $event) { - if ($event->getMetaModel() !== null) { - /** @psalm-suppress DeprecatedMethod */ - if (!($metaModel = $event->getMetaModel()) instanceof ITranslatedMetaModel && $metaModel->isTranslated()) { + if (null !== ($metaModel = $event->getMetaModel())) { + /** + * @psalm-suppress DeprecatedMethod + * @psalm-suppress TooManyArguments + */ + if (!($metaModel instanceof ITranslatedMetaModel) && $metaModel->isTranslated(false)) { // @codingStandardsIgnoreStart @\trigger_error( 'Translated "\MetaModel\IMetamodel" instances are deprecated since MetaModels 2.2 ' . @@ -259,6 +262,7 @@ public function createMetaModel(CreateMetaModelEvent $event) ); // @codingStandardsIgnoreEnd } + return; } From 26cb10f779f9a41f70af03bdc3fd73412763f9f7 Mon Sep 17 00:00:00 2001 From: Ingolf Steinardt Date: Thu, 8 Aug 2024 08:39:38 +0200 Subject: [PATCH 2/2] Fix composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bf50960a4..0fd7b64b8 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "require": { "php": "^8.1", "ext-dom": "*", - "contao-community-alliance/dc-general": "^2.3.18", + "contao-community-alliance/dc-general": "^2.3.19", "contao-community-alliance/events-contao-bindings": "^4.13.1", "contao-community-alliance/meta-palettes": "^2.0.10", "contao-community-alliance/translator": "^2.4.2",