fix(polly_media): stop overriding host form submit handlers

formAlter() appended widgetFormSubmitCallback to the submit button of every entity form. Once a button defines #submit, Drupal runs only the button handlers and ignores the form-level handler, so any EntityForm relying on ::submitForm (e.g. taxonomy OverviewTerms in D11) stopped saving — term reordering silently did nothing.

Scope the attachment to forms that actually render a synthesizable media widget via a form_state flag set in fieldWidgetCompleteFormAlter(), and attach the callback to the button only when it already has handlers, otherwise to the form-level #submit, so existing handlers are never suppressed.

Closes #3600850

Merge request reports

Loading