Skip to content

Commit

Permalink
Add normalizer interface
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon committed Jan 13, 2025
1 parent daf8dbf commit 963ecad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DataObject/Data/Adapter/LinkAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Pimcore\Model\DataObject\ClassDefinition\Data;
use Pimcore\Model\DataObject\Concrete;
use Pimcore\Model\DataObject\Data\Link;
use Pimcore\Normalizer\NormalizerInterface;
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;

/**
Expand Down Expand Up @@ -64,7 +65,7 @@ public function getDataForSetter(

public function normalize(mixed $value, Data $fieldDefinition): mixed
{
if (!$value instanceof Link) {
if (!$value instanceof Link || !$fieldDefinition instanceof NormalizerInterface) {
return null;
}

Expand Down

0 comments on commit 963ecad

Please sign in to comment.