From c15df5d3b8c5c24ef29fd51bc41db43301b0952d Mon Sep 17 00:00:00 2001 From: Konrad Oboza <34310128+konradoboza@users.noreply.github.com> Date: Tue, 14 Apr 2020 16:48:20 +0200 Subject: [PATCH] EZP-31459: [UDW] Allowed Content Types are not respected in object relation field (#1307) --- .../Event/Subscriber/ObjectRelationAllowedContentTypes.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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);