diff --git a/core/modules/media_library/css/media_library.theme.css b/core/modules/media_library/css/media_library.theme.css index 2710095f9f..1f66614e22 100644 --- a/core/modules/media_library/css/media_library.theme.css +++ b/core/modules/media_library/css/media_library.theme.css @@ -542,7 +542,7 @@ .media-library-add-form__media { position: relative; display: flex; - padding: 1em 0 1em 0; + padding: 1em 0; border-bottom: 1px solid #c0c0c0; outline: none; } diff --git a/core/modules/media_library/src/Form/AddFormBase.php b/core/modules/media_library/src/Form/AddFormBase.php index 16b7908fd1..a3975be376 100644 --- a/core/modules/media_library/src/Form/AddFormBase.php +++ b/core/modules/media_library/src/Form/AddFormBase.php @@ -422,7 +422,7 @@ protected function buildSelectedItemElement(MediaInterface $media, array $form, '#title' => $this->t('Select @name', ['@name' => $media->label()]), '#title_display' => 'invisible', '#return_value' => $media->id(), - // The checkbox’s value is never processed by this form. It is present + // The checkbox's value is never processed by this form. It is present // for usability and accessibility reasons, and only used by // JavaScript to track whether or not this media item is selected. The // hidden 'current_selection' field is used to store the actual IDs of @@ -785,6 +785,8 @@ protected function getSourceFieldName(MediaTypeInterface $media_type) { * An array containing the pre-selected media items keyed by ID. */ protected function getPreSelectedMediaItems(FormStateInterface $form_state) { + // Get the current select from the form state. + // @see ::processInputValues() $media_ids = $form_state->get('current_selection'); if (!$media_ids) { return [];