Skip to content
Snippets Groups Projects
Commit 654383e2 authored by wodby's avatar wodby Committed by Martin Leblanc
Browse files

ISTWCMS-5204: fixing getting images in service

parent a119285b
No related branches found
No related tags found
1 merge request!180ISTWCMS-5204: updating node theming to use a free flowing image
...@@ -356,7 +356,7 @@ class UwNodeFieldValue { ...@@ -356,7 +356,7 @@ class UwNodeFieldValue {
} }
// If there is a type for the image, add it to the array. // If there is a type for the image, add it to the array.
if (isset($extra_options['type'])) { if (!empty($image) && isset($extra_options['type'])) {
$image['type'] = $extra_options['type']; $image['type'] = $extra_options['type'];
} }
...@@ -640,6 +640,7 @@ class UwNodeFieldValue { ...@@ -640,6 +640,7 @@ class UwNodeFieldValue {
$return_sources = []; $return_sources = [];
if ($node->$field_name) { if ($node->$field_name) {
// Get the image entity. // Get the image entity.
$image = $node->$field_name->entity; $image = $node->$field_name->entity;
...@@ -648,7 +649,7 @@ class UwNodeFieldValue { ...@@ -648,7 +649,7 @@ class UwNodeFieldValue {
$sources = $this->uwService->prepareResponsiveImage($image, 'uw_ris_media'); $sources = $this->uwService->prepareResponsiveImage($image, 'uw_ris_media');
} }
else { else {
$sources = NULL; return [];
} }
if (isset($sources['responsive_sources'])) { if (isset($sources['responsive_sources'])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment