Merge pull request #975 from bolt/bobdenotter-patch-1

Get the first imagefield that actually has an image in it
This commit is contained in:
Ivo Valchev
2020-01-31 09:06:18 +01:00
committed by GitHub

View File

@@ -139,7 +139,7 @@ class ContentExtension extends AbstractExtension
}
foreach ($content->getFields() as $field) {
if ($field instanceof ImageField) {
if ($field instanceof ImageField && $field->get('filename')) {
return $onlyValues ? $field->getValue() : $field;
}
}