Allowing elements to be dynamically added to a select box or a set of checkboxes despite Drupal's zealous form validation
- drupal 8 make changes to form after validation fail
Looks like the same problem: New values get lost during form validation when using select2boxes multiple values widget [#3228646] | Drupal.org
- drupal 8 how to override any class
- drupal 8 override FormValidator
My first hint that you definitely could override this core service was chx proposing that one should not be able to: [security weakness] Hardwire FormValidator [#2282089] | Drupal.org
How that actually works: Services and dependency injection in Drupal 8+ | Services and dependency injection | Drupal Wiki guide on Drupal.org
Other
- Something i thought at some point might be related to what i was trying to do: FormValidator::doValidateForm will validate each form element and relies on FormState::setError to suppress the generated errors instead validating only the form elements defined through #limit_validation_errors [#2818647] | Drupal.org
- Incidental tiny core comment fix that came out of this: Fix copy-paste mistake in code comment [#3229012] | Drupal.org