From c9c476e21c828bb484774621bfd6af217fa8bf65 Mon Sep 17 00:00:00 2001 From: markus-moser Date: Tue, 3 Dec 2024 15:14:17 +0100 Subject: [PATCH 1/8] Add class_alias for asset field definition adapters --- src/autoload.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/autoload.php b/src/autoload.php index 622e3cf6..0d14b1a7 100644 --- a/src/autoload.php +++ b/src/autoload.php @@ -68,10 +68,17 @@ use Pimcore\Bundle\GenericDataIndexBundle\Model\OpenSearch\Traits\QueryObjectsToArrayTrait as OpenSearchQueryObjectsToArrayTrait; use Pimcore\Bundle\GenericDataIndexBundle\Model\OpenSearch\Traits\SimplifySingleTypesTrait as OpenSearchSimplifySingleTypesTrait; use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\DefaultSearch\Asset\FieldDefinitionAdapter\AbstractAdapter as AssetAbstractAdapter; +use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\DefaultSearch\Asset\FieldDefinitionAdapter\BooleanAdapter; +use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\DefaultSearch\Asset\FieldDefinitionAdapter\DateAdapter; +use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\DefaultSearch\Asset\FieldDefinitionAdapter\KeywordAdapter; +use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\DefaultSearch\Asset\FieldDefinitionAdapter\RelationAdapter; +use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\DefaultSearch\Asset\FieldDefinitionAdapter\TextKeywordAdapter; use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\DefaultSearch\DataObject\FieldDefinitionAdapter\AbstractAdapter as DataObjectAbstractAdapter; use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\OpenSearch\Asset\FieldDefinitionAdapter\AbstractAdapter as OpenSearchAssetAbstractAdapter; use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\OpenSearch\DataObject\FieldDefinitionAdapter\AbstractAdapter as OpenSearchDataObjectAbstractAdapter; +const ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE = 'Pimcore\\Bundle\GenericDataIndexBundle\\SearchIndexAdapter\\DefaultSearch\\Asset\\FieldDefinitionAdapter'; + $classesToAlias = [ AttributeType::class => OpenSearchAttributeType::class, ConditionType::class => OpenSearchConditionType::class, @@ -101,6 +108,11 @@ DefaultSearchInterface::class => OpenSearchSearchInterface::class, AssetAbstractAdapter::class => OpenSearchAssetAbstractAdapter::class, DataObjectAbstractAdapter::class => OpenSearchDataObjectAbstractAdapter::class, + ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'BooleanAdapter' => BooleanAdapter::class, + ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'DateAdapter' => DateAdapter::class, + ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'KeywordAdapter' => KeywordAdapter::class, + ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'RelationAdapter' => RelationAdapter::class, + ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'TextKeywordAdapter' => TextKeywordAdapter::class, ]; foreach ($classesToAlias as $originalClass => $aliasClass) { From 11bd99eda8081b8e041aa379e8afc27cfa9612c4 Mon Sep 17 00:00:00 2001 From: markus-moser Date: Tue, 3 Dec 2024 15:20:06 +0100 Subject: [PATCH 2/8] Remove roave/security-advisories --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 8de837ea..6d2caefb 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,6 @@ "symfony/messenger": "^6.4" }, "require-dev": { - "roave/security-advisories": "dev-latest", "codeception/codeception": "^5.0.10", "codeception/phpunit-wrapper": "^9", "codeception/module-asserts": "^2", From 230e06aa2616a72af8db4585dc3d194698a5f775 Mon Sep 17 00:00:00 2001 From: markus-moser Date: Tue, 3 Dec 2024 15:29:40 +0100 Subject: [PATCH 3/8] Fix namespace --- src/autoload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/autoload.php b/src/autoload.php index 0d14b1a7..d0c99f0a 100644 --- a/src/autoload.php +++ b/src/autoload.php @@ -77,7 +77,7 @@ use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\OpenSearch\Asset\FieldDefinitionAdapter\AbstractAdapter as OpenSearchAssetAbstractAdapter; use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\OpenSearch\DataObject\FieldDefinitionAdapter\AbstractAdapter as OpenSearchDataObjectAbstractAdapter; -const ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE = 'Pimcore\\Bundle\GenericDataIndexBundle\\SearchIndexAdapter\\DefaultSearch\\Asset\\FieldDefinitionAdapter'; +const ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE = 'Pimcore\\Bundle\GenericDataIndexBundle\\SearchIndexAdapter\\DefaultSearch\\Asset\\FieldDefinitionAdapter\\'; $classesToAlias = [ AttributeType::class => OpenSearchAttributeType::class, From 9d467bec968879e3740a447cebca066424bbcc48 Mon Sep 17 00:00:00 2001 From: markus-moser Date: Tue, 3 Dec 2024 15:40:18 +0100 Subject: [PATCH 4/8] Try to re-enable roave/security-advisories --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 6d2caefb..8de837ea 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ "symfony/messenger": "^6.4" }, "require-dev": { + "roave/security-advisories": "dev-latest", "codeception/codeception": "^5.0.10", "codeception/phpunit-wrapper": "^9", "codeception/module-asserts": "^2", From 0a664ab1e6f66dece7c9dc9effc474b599b12134 Mon Sep 17 00:00:00 2001 From: markus-moser Date: Tue, 3 Dec 2024 15:41:39 +0100 Subject: [PATCH 5/8] Disable roave/security-advisories again for now --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 8de837ea..6d2caefb 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,6 @@ "symfony/messenger": "^6.4" }, "require-dev": { - "roave/security-advisories": "dev-latest", "codeception/codeception": "^5.0.10", "codeception/phpunit-wrapper": "^9", "codeception/module-asserts": "^2", From 5225805514a777c3b7f012628d71b0ac95cadf1d Mon Sep 17 00:00:00 2001 From: markus-moser Date: Tue, 3 Dec 2024 16:21:36 +0100 Subject: [PATCH 6/8] Fix alias namespace --- src/autoload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/autoload.php b/src/autoload.php index d0c99f0a..2eb236c3 100644 --- a/src/autoload.php +++ b/src/autoload.php @@ -77,7 +77,7 @@ use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\OpenSearch\Asset\FieldDefinitionAdapter\AbstractAdapter as OpenSearchAssetAbstractAdapter; use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\OpenSearch\DataObject\FieldDefinitionAdapter\AbstractAdapter as OpenSearchDataObjectAbstractAdapter; -const ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE = 'Pimcore\\Bundle\GenericDataIndexBundle\\SearchIndexAdapter\\DefaultSearch\\Asset\\FieldDefinitionAdapter\\'; +const ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE = 'Pimcore\\Bundle\GenericDataIndexBundle\\SearchIndexAdapter\\OpenSearch\\Asset\\FieldDefinitionAdapter\\'; $classesToAlias = [ AttributeType::class => OpenSearchAttributeType::class, From 51cf73cdf366e9076ab5cfd9b7f999d0340a3ccb Mon Sep 17 00:00:00 2001 From: markus-moser Date: Tue, 3 Dec 2024 16:40:59 +0100 Subject: [PATCH 7/8] Fix alias namespace --- src/autoload.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/autoload.php b/src/autoload.php index 2eb236c3..8fef290e 100644 --- a/src/autoload.php +++ b/src/autoload.php @@ -108,11 +108,11 @@ DefaultSearchInterface::class => OpenSearchSearchInterface::class, AssetAbstractAdapter::class => OpenSearchAssetAbstractAdapter::class, DataObjectAbstractAdapter::class => OpenSearchDataObjectAbstractAdapter::class, - ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'BooleanAdapter' => BooleanAdapter::class, - ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'DateAdapter' => DateAdapter::class, - ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'KeywordAdapter' => KeywordAdapter::class, - ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'RelationAdapter' => RelationAdapter::class, - ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'TextKeywordAdapter' => TextKeywordAdapter::class, + BooleanAdapter::class => ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'BooleanAdapter', + DateAdapter::class => ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'DateAdapter', + KeywordAdapter::class => ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'KeywordAdapter', + RelationAdapter::class => ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'RelationAdapter', + TextKeywordAdapter::class => ASSET_FIELD_DEFINITION_ADAPTER_NAMESPACE . 'TextKeywordAdapter', ]; foreach ($classesToAlias as $originalClass => $aliasClass) { From db7721cfbb8e891a4a085f956e52583e2568d7fd Mon Sep 17 00:00:00 2001 From: markus-moser Date: Tue, 3 Dec 2024 17:54:11 +0100 Subject: [PATCH 8/8] Try to re-enable roave/security-advisories --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 6d2caefb..8de837ea 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ "symfony/messenger": "^6.4" }, "require-dev": { + "roave/security-advisories": "dev-latest", "codeception/codeception": "^5.0.10", "codeception/phpunit-wrapper": "^9", "codeception/module-asserts": "^2",