diff --git a/src/lib/UniversalDiscovery/Event/Subscriber/ObjectRelationAllowedContentTypes.php b/src/lib/UniversalDiscovery/Event/Subscriber/ObjectRelationAllowedContentTypes.php index 549c75b387..fbc3e56a61 100644 --- a/src/lib/UniversalDiscovery/Event/Subscriber/ObjectRelationAllowedContentTypes.php +++ b/src/lib/UniversalDiscovery/Event/Subscriber/ObjectRelationAllowedContentTypes.php @@ -36,7 +36,7 @@ public function onUdwConfigResolve(ConfigResolveEvent $event): void } if ( - !isset($context['type'], $context['allowed_content_types'], $config['allowed_content_types']) + !isset($context['type'], $context['allowed_content_types']) || 'object_relation' !== $context['type'] ) { return; @@ -54,7 +54,9 @@ public function onUdwConfigResolve(ConfigResolveEvent $event): void ? null : $intersection; } else { - $config['allowed_content_types'] = $context['allowed_content_types']; + $config['allowed_content_types'] = empty($context['allowed_content_types']) + ? null + : $context['allowed_content_types']; } $event->setConfig($config);