Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • wcms/uw_cfg_common
1 result
Show changes
Commits on Source (7)
......@@ -11,6 +11,8 @@ allowed_bundles:
- uw_ct_contact
- uw_ct_event
- uw_ct_news_item
- uw_ct_opportunity
- uw_ct_profile
- uw_ct_service
- uw_ct_sidebar
- uw_ct_web_page
......@@ -108,7 +108,10 @@ function uw_cfg_common_entity_presave(EntityInterface $entity) {
if ($entity->getEntityTypeId() == 'node') {
// If there is a hero image (media), continue to process.
if ($media = $entity->field_uw_hero_image->entity) {
if (
$entity->hasField('field_uw_hero_image') &&
$media = $entity->field_uw_hero_image->entity
) {
// Hero media exists, get file entity from media.
if ($file = $media->field_media_image->entity) {
......