From 6345b63d753c109d56c1da2baef2d0b0f892d799 Mon Sep 17 00:00:00 2001 From: Olivier PORTIER Date: Fri, 27 Jan 2017 11:39:37 +0100 Subject: [PATCH] Fix issue that break fallback to yml configuration if content field meta is empty A simple check if $configuration[$meta->getName()] for the field is not empty before overriding configuration pattern. Otherwise the configuration set from yml file is overriden with empty data. --- Twig/NovaeZSEOExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Twig/NovaeZSEOExtension.php b/Twig/NovaeZSEOExtension.php index 28e016d..e5fae42 100644 --- a/Twig/NovaeZSEOExtension.php +++ b/Twig/NovaeZSEOExtension.php @@ -216,7 +216,7 @@ protected function innerComputeMetas( Content $content, $fieldDefIdentifier, Con $fieldDefinition = $contentType->getFieldDefinition( $fieldDefIdentifier ); $configuration = $fieldDefinition->getFieldSettings()['configuration']; // but if we need something is the configuration we take it - if ( isset($configuration[$meta->getName()]) ) + if ( isset($configuration[$meta->getName()]) && !empty($configuration[$meta->getName()]) ) { $meta->setContent( $configuration[$meta->getName()] ); }