Skip to content

Commit

Permalink
Fix data object normalizer and improve field definition adapter for W…
Browse files Browse the repository at this point in the history
…YSIWYG (#22)
  • Loading branch information
markus-moser authored Feb 2, 2024
1 parent ecddacc commit 383b976
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ services:
autoconfigure: true
public: false

Pimcore\Bundle\GenericDataIndexBundle\Service\SearchIndex\DataObject\FieldDefinitionAdapter\TextAdapter:
Pimcore\Bundle\GenericDataIndexBundle\Service\SearchIndex\DataObject\FieldDefinitionAdapter\TextKeywordAdapter:
shared: false
tags:
- { name: "pimcore.generic_data_index.data-object.search_index_field_definition", type: "wysiwyg" }
- { name: "pimcore.generic_data_index.data-object.search_index_field_definition", type: "textarea" }

Pimcore\Bundle\GenericDataIndexBundle\Service\SearchIndex\DataObject\FieldDefinitionAdapter\TextKeywordAdapter:
shared: false
tags:
- { name: "pimcore.generic_data_index.data-object.search_index_field_definition", type: "select" }
- { name: "pimcore.generic_data_index.data-object.search_index_field_definition", type: "multiselect" }
- { name: "pimcore.generic_data_index.data-object.search_index_field_definition", type: "input" }
Expand Down
5 changes: 2 additions & 3 deletions src/Service/Normalizer/DataObjectNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
use Pimcore\Model\DataObject\Concrete;
use Pimcore\Model\DataObject\Folder;
use Pimcore\Model\DataObject\Localizedfield;
use Symfony\Component\Serializer\Exception\ExceptionInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

/**
Expand Down Expand Up @@ -118,7 +117,7 @@ private function normalizeStandardFields(Concrete $dataObject): array
foreach ($dataObject->getClass()->getFieldDefinitions() as $key => $fieldDefinition) {

$value = $dataObject->get($key);
if($fieldDefinition instanceof NormalizerInterface) {
if($fieldDefinition instanceof \Pimcore\Normalizer\NormalizerInterface) {
$value = $fieldDefinition->normalize($value);
}

Expand All @@ -129,7 +128,7 @@ private function normalizeStandardFields(Concrete $dataObject): array
Localizedfield::setGetFallbackValues($fallbackLanguagesBackup);

return $result;
} catch (Exception|ExceptionInterface $e) {
} catch (Exception $e) {
throw new DataObjectNormalizerException($e->getMessage());
}
}
Expand Down

This file was deleted.

0 comments on commit 383b976

Please sign in to comment.