Skip to content
Snippets Groups Projects
Commit 35145194 authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-7035: add code to zero out any banners when the type of media is set to none

parent 9080f1fd
No related branches found
No related tags found
No related merge requests found
......@@ -116,6 +116,15 @@ function uw_cfg_common_entity_presave(EntityInterface $entity) {
}
}
}
// If there is a type of media, check if it is set
// to none and if it is then zero out any banners
// that were added.
if ($entity->hasField('field_uw_type_of_media')) {
if (!$entity->field_uw_type_of_media->value) {
$entity->set('field_uw_banner', NULL);
}
}
}
}
......
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