.ui-dialog-buttonpane missing on media select dialog

Created on 26 September 2024, about 2 months ago

Problem/Motivation

The action bar at the bottom of the media insert panel has disappeared from display on my dev site, Ok on live.
It's not hidden, it's just not generated. " 0 of 1 item selected ........... [Insert selected ]" - full HTML:

<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
  <div class="media-library-selected-count js-media-library-selected-count" role="status" aria-live="polite" aria-atomic="true">0 of 1 item selected</div>
  <div class="ui-dialog-buttonset form-actions"><button type="button" class="media-library-select button button--primary js-form-submit form-submit ui-button ui-corner-all ui-widget" data-once="drupal-ajax">Insert selected</button></div>
</div>

Steps to reproduce

Edit a node that has an image field (Entity reference • Reference type: Media • Media type: Image)
Click ‘Add media’ button
See 'Add or select media' dialog with previously loaded images
ui-dialog-buttonpan is missing from bottom.

Proposed resolution

Understand how this is added - code or config and fix.
It is built in core/modules/media_library/src/Plugin/views/field/MediaLibrarySelectForm.php viewsForm()

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

10.3

Component

media system

Created by

🇬🇧United Kingdom Jons

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Jons
  • 🇮🇳India nayana_mvr

    This issue is not reproducible in Drupal versions 10.4.x and 11.x. Verified it by adding entity reference media field in content type and paragraph. Attaching screenshots for reference. Also, I didn't get the point that this occurs in dev site and in live site it is working. Please let me know if there is any specific step to be followed other than the steps mentioned in the IS to reproduce this issue in vanilla Drupal setup.

  • 🇬🇧United Kingdom Jons

    I've tried to debug through this - the 'Insert selected' is added in MediaLibrarySelectForm.php
    $form['actions']['submit']['#value'] = $this->t('Insert selected');

    This seems to be a viewsForm field so more complex than a simple form.
    The processing does a number of doBuildForm() in FormBuilder.php and at some point 'Insert selected' gets lost or relevant HTML not generated.

    So any hints on tracking down would be helpful - code or config etc.

  • 🇬🇧United Kingdom Jons

    The dialog is related to a View: Media library Page (/admin/content/media-widget) - same layout etc. The action bar is missing from this also.
    The action line is missing from the Views UI page as well!

    A comparison of configsync directories between live and dev shows no differences

  • @jons this was an issue in drupal/gin:3.0.0-rc11 and fixed in rc12
    Maybe you're using Gin too?

  • 🇳🇱Netherlands idebr

    Linking the related issue in the Gin theme

  • 🇬🇧United Kingdom Jons

    Thanks for great help @wotts @idebr

    It was the Sticky setting, ' Enable sticky action buttons', which was different on dev compared to live (I missed this in checking).
    (In gin.settings.yml: sticky_action_buttons: true)

    Switching this off makes the buttons appear again!

    I'm on 3.0.0-rc13 so maybe the issue has come back.

    Looking at Gin issue, if I set sticky on again and apply #29 then go to edit a node with a media field, the buttons appear on initial ('Add or select media') dialog, but disappear if you select a different directory and click Apply filters.

    I'll add this to 3455080

  • 🇬🇧United Kingdom AndyF

    Hi, I'm also seeing this with Drupal 10.2.10 and Gin 3.0.0-rc13, only when is enabled.

Production build 0.71.5 2024