Prevent publishing when `block` component instance values do not #validate
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3542102. -->
Reported by: [bnjmnm](https://www.drupal.org/user/2369194)
Related to !287
>>>
<h3 id="overview">Overview</h3>
<p>In testing <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/experience_builder/issues/3523496" title="Status: Closed (fixed)">#3523496: Block component instance form values not processed by validation/submit handlers</a></span> it was discovered that we could publish content that included a webform block, even if the entity reference field referenced a non-existent block. <em>This was discovered with webform, but could occur on any entity reference that requires that value to reference an entity that exists.</em><br>
If we publish content with this invalid block field value, then the Page will crash on render.</p>
<p>In standard forms, validation prevents this from happening:<br>
<img src="https://www.drupal.org/files/issues/2025-08-19/Screenshot%202025-08-19%20at%201.37.04%E2%80%AFPM_0.png" alt="" width="400"></p>
<p>We know that #validation callbacks run on value changes as of <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/experience_builder/issues/3523496" title="Status: Closed (fixed)">#3523496: Block component instance form values not processed by validation/submit handlers</a></span>, but it <strong>seems like</strong> (please verify) they do not prevent publishing from occurring. If this isn't the reason, lets be sure to update the issue summary to remove that theory.</p>
<h3 id="proposed-resolution">Proposed resolution</h3>
<h3 id="ui-changes">User interface changes</h3>
> Related issue: [Issue #3523496](https://www.drupal.org/node/3523496)
> Related issue: [Issue #3520484](https://www.drupal.org/node/3520484)
issue