This is a follow up of #2856950: Add a possibility to disable inline form errors for a complete form.

If contrib adds RenderElements that need to show Inline Form Errors while not implementing FormElementInterface, they need a way to let IFE know that they do.

IFE code has the following check:

+++ b/core/modules/inline_form_errors/src/SupportedRenderElementHelper.php
@@ -0,0 +1,79 @@
+  public function supportsInlineFormErrors($element_type) {
+    return in_array($element_type, $this->pseudoFormElements) || $this->elementInstanceOfFormElementInterface($element_type);
+  }

Proposal

- Add a property to the annotations of RenderElements
- In SupportedRenderElementHelper.php gather all supported RenderElements based on the annotations and elementInstanceOfFormElementInterface
- Remove the hardcoded list of $this->pseudoFormElements

Comments

dmsmidt created an issue. See original summary.

dmsmidt’s picture