Using action-buttons causes required-field validation errors
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3567974. -->
Reported by: [fago](https://www.drupal.org/user/16747)
>>>
<h3 id="summary-problem-motivation">Problem</h3>
<p>Have a field action button, e.g. to summarize a title or to generate the alt-text field. When the title/alt field is required, the button is showing a validation error.</p>
<p>While for the image alt text case it could be solved with #limit_validation_errors, the summarize title is more complicated. The tittle summary action needs the form to be validated, such that the entity is going to be updated accordingly. Note that values being NOT validated are NOT updated in the entity, what is right security wise.</p>
<h4 id="summary-steps-reproduce">Desired behavior</h4>
<p>I think for the title summary use-case, we want<br>
- no required field validation<br>
- other validation should run so that entity values are updated. informing the user if some other validation fails makes sense, so errors should be shown</p>
<p>For the image-alt use-case we want to limit validation to the image field. Other stuff is not relevant.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>1. We need to know how validation should run. We have two different intended behaviors, so we need a setting for that or a find a way to auto-detect the right behavior.<br>
2. The module already implements a work-a-round using the core patch from <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-13"><a href="https://www.drupal.org/project/drupal/issues/2476569" title="Status: Needs work">#2476569: Suppress validation of required fields on ajax calls</a></span>, but that's not a good permanent solution. We need to get the core patch for #suppress_required_fields_validation in + document that it can be used.<br>
3. It would be great if we could find an interim workaround to make 2. work without the core patch for now.</p>
issue