- $media_is_enabled = \Drupal::moduleHandler()->moduleExists('media');
- // Only attach CSS from core if this form comes from Media core, and not from
- // the contrib Media Entity 1.x branch.
- if ($media_is_enabled && $form_state->getFormObject() instanceof MediaForm) {
- // @todo Revisit after https://www.drupal.org/node/2892304 is in. It
- // introduces a footer region to these forms which will allow for us to
- // display a top border over the published checkbox by defining a
- // media-edit-form.html.twig template the same way node does.
- $form['#attached']['library'][] = 'seven/media-form';
- }
+ // @todo Revisit after https://www.drupal.org/node/2892304 is in. It
+ // introduces a footer region to these forms which will allow for us to
+ // display a top border over the published checkbox by defining a
+ // media-edit-form.html.twig template the same way node does.
+ $form['#attached']['library'][] = 'seven/media-form';