Save button missing in modal for editing media using Media Library Edit module

Created on 17 June 2024, 5 months ago

Problem/Motivation

I have encountered an issue when using the Media Library Edit module in combination with the Gin theme.
The Media Library Edit β†’ module adds an "Edit" button to the Media Library widget, allowing users to edit media entities directly from the node edit form. When the "Edit" button is clicked, a modal opens containing the media edit form. but, on the Gin theme, the modal does not display the save button, preventing users from saving their changes to the media entity.

I found that the Gin theme uses a custom template for the node edit form (node-edit-form.html.twig). This template excludes the 'actions' element from the form using the following line:

{{ form|without('advanced', 'footer', 'actions', 'gin_actions', 'gin_sidebar', 'gin_sidebar_toggle') }}

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

  • Issue created by @hosisam
  • πŸ‡³πŸ‡±Netherlands Dries Arnolds πŸ‡³πŸ‡± Amsterdam

    I have the same issue with the combination of Gin and Media Library Edit, since the upgrade to 3.11

    Changing the Twig template also fixes it for me. Does this have anything to do with the new sticky buttons functionality destined for 4.x?

  • πŸ‡§πŸ‡ͺBelgium bramvandenbulcke

    Same here!

    This regressions started with Gin release 8.x-3.0-rc11.

  • πŸ‡ΊπŸ‡ΈUnited States cbwiedel

    Can confirm Gin is not rendering the bottom of the edit modal, more specifically the 'ui-dialog-buttonpane' at the bottom. I'm using the media_library_media_modify module

  • First commit to issue fork.
  • Merge request !435Do not use gin content form in ajax requests β†’ (Merged) created by hudri
  • πŸ‡¦πŸ‡ΉAustria hudri Austria

    My merge requests assumes that Gin content forms should never be used for Ajax requests, because forms in Ajax requests don't render the page template or the local actions block. This fixes it for the media library edit button, and theoretically this should also prevent similar problems with modules like Inline Entity Forms.

    My assumption is a fairly broad approch, so feedback is welcome.

  • Pipeline finished with Failed
    5 months ago
    Total: 240s
    #203476
  • Pipeline finished with Failed
    5 months ago
    Total: 331s
    #203491
  • Status changed to Needs review 5 months ago
  • πŸ‡¦πŸ‡ΉAustria hudri Austria
  • Pipeline finished with Success
    5 months ago
    #203497
  • πŸ‡΅πŸ‡±Poland besek

    Thank you @hundri! I've verified your fix and it works very well!

  • @hundri thanks for the fix, it works well for me as well.

  • Status changed to Active 5 months ago
  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    @hudri thank you for the MR πŸ™‡

    I left you a question πŸ‘€

  • Pipeline finished with Running
    5 months ago
    #203535
  • Status changed to Needs review 5 months ago
  • πŸ‡¦πŸ‡ΉAustria hudri Austria
  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    @hudri sounds good πŸ‘

    Waiting for another round of re-reviews to confirm it's still working properly, afterwards we can merge this ASAP and issue a new release πŸ‘€

  • πŸ‡¦πŸ‡ΉAustria hudri Austria

    Tests from Drupal commerce users would be helpful, this would cross-check compatiblity with Inline Entity Form module.

  • πŸ‡΅πŸ‡±Poland besek

    I didn't check with Inline Entity Form, but just in case I tested compatibility with other modules, where it could potentially impact behaviour:
    - Views Bulk Operations
    - Views Entity Form Field
    - Dashboards with Layout Builder
    All of them seems to be working fine, with or without this patch :)

  • πŸ‡«πŸ‡·France duaelfr Montpellier, France

    Here is the patch for people wanting to apply it directly on RC11.
    I can confirm it fixes the issue for the media edit modal introduced by the Core patch here ✨ Allow media items to be edited in a modal when using the field widget Postponed

  • πŸ‡΅πŸ‡±Poland besek

    @DuaelFr, there are small differences between your patch and what is in mr. Can you please clarify them? I'm wondering what is the goaald and which one should be used for patching RC11 on my website

  • πŸ‡«πŸ‡·France duaelfr Montpellier, France

    @besek MR's patch is against 3.x-dev so it does not apply on rc11. This patch is a workaround for people who need this change but cannot wait for the next release and/or cannot switch to the development version of the theme.

  • πŸ‡΅πŸ‡±Poland besek

    Ok, thanks for clarification and the patch. I was testing mr on rc11 and it worked fine, so I thought this would be enough to use it as a patch.

  • πŸ‡§πŸ‡ͺBelgium davidiio

    We applied patch from #18 and media library edit modal now diaplays save button.
    Tried it on Drupal 10.3, gin 3.x-rc11 and media_library_edit 3.0.3

  • Status changed to RTBC 5 months ago
  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich
  • Status changed to Fixed 5 months ago
  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    Thanks! I've also ported this to the 4.0.x branch

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Thank you very much for fixing this! :) I was looking for the reason and finally found it here.
    Is a new -rc12 release planned soon? Looks like several issues were recently fixed in -dev. Or should we use the patch?

  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    This was released today

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Thank you very very much @saschaeggi! :)

  • πŸ‡ͺπŸ‡ΈSpain eduardo morales alberti Spain, πŸ‡ͺπŸ‡Ί

    Thank you @saschaeggi

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • πŸ‡·πŸ‡΄Romania Stefan Vaduva

    Sorry to reopen this, but it seems that it does not fix the problem for the Entity Browser Modal

  • πŸ‡·πŸ‡΄Romania Stefan Vaduva

    And the patch :)

  • I'm seeing the same issue in views - cannot change settings unless I right click, open in new tab (ie no modal)

  • πŸ‡©πŸ‡ͺGermany bekro Mannheim

    I'm also experiencing this issue in version rc13 (D10.3.1). Using the media_library_media_modify module. It seems to work with media fields in paragraphs but not in media fields directly in nodes. Patch in #29 fixed it and works for me.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    @saschaeggi then *ping* for reopening?

  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    No need to reopen this, see the related open issues/MRs which need a review instead.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Sorry didn't see that =/

  • πŸ‡¬πŸ‡§United Kingdom Jons

    I encountered this ( https://www.drupal.org/project/drupal/issues/3477114 πŸ› .ui-dialog-buttonpane missing on media select dialog Active )

    If 'Enable sticky action buttons' is on (gin.settings.yml: sticky_action_buttons: true) the buttons don't appear in various places - Views admin etc. Disabling makes them work again.

    I'm on 3.0.0-rc13

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

  • πŸ‡ΊπŸ‡ΈUnited States jnicola

    This is not fixed for us with latest in 3.x dev branch.

    Linked tickets also seem to be closed for duplicate, or the one core issue just trails off with folks pointing to this project (gin).

    What is the actual solution for folks using 3.x? Given how many people have come back here and mentioned it is still not working this does not seem to be marked appropriately as fixed.

  • πŸ‡ΊπŸ‡ΈUnited States ccjjmartin Austin, TX

    Can confirm that #29 fixed the issue for me.

  • πŸ‡ΊπŸ‡ΈUnited States kevinfunk

    +1 that the patch from #29 fixes the issue.
    I was seeing the issue using the Acquia DAM module and it happened when DAM was selected when the modal was opened.

Production build 0.71.5 2024