public function requirePrimaryImage(Errors &$errors, NodeRef $nodeRef, Node &$node) { $element = $nodeRef->getElement(); $schema = $element->getSchema(); if (!PartialUtils::isTagRoleInOutTagsScope($schema, $node->getNodePartials(), '#primary-image')) { // this should only occur during bulk cms actions return; } if ($schema->hasTagDef('#primary-image')) { $primaryImageTag = $node->getOutTag('#primary-image'); $errors->rejectIfEmpty('#primary-image', 'tag', 'Primary Image', $primaryImageTag); } }