RuntimeException: media_library.opener.form_element must be an instance of Drupal\media_library\MediaLibraryOpenerInterface

Created on 25 June 2024, 5 months ago
Updated 15 July 2024, 4 months ago

Problem/Motivation

As noted in https://www.drupal.org/project/drupal/issues/3446026 πŸ› Adding media library openers use autoconfigure and tags in 10.3.x has BC consequences Active , a change was made in 10.3.x where adding media library openers to use autoconfigure and tags in 10.3.x has BC consequences. I believe this is affecting this module when using on 10.3.0.

Steps to reproduce

* Install drupal 10.3.0
* Enable bootstrap_styles which uses this module
* Try to add a media element to a section bacground
* See error: RuntimeException: media_library.opener.form_element must be an instance of Drupal\media_library\MediaLibraryOpenerInterface

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States johnlutz

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

Merge Requests

Comments & Activities

  • Issue created by @johnlutz
  • Status changed to Needs review 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States johnlutz
  • Pipeline finished with Failed
    5 months ago
    Total: 155s
    #208688
  • Assigned to mark_fullmer
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    Thanks for the bug report and the proposed change! Assigning myself for review...

  • πŸ‡¨πŸ‡¦Canada bwaindwain

    I've tested mr12 and works great. Thanks @johnlutz! +RTBC

  • Pipeline finished with Skipped
    5 months ago
    #209913
  • Status changed to Fixed 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    Agreed. This looks good! Merging to the 2.x branch.

  • Status changed to Active 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    Re-opening, since as implied by the original description, this has backwards compatibility consequences: previous versions of media_library_form_element will not work with Drupal core 10.3 or above.

    Given this, we should probably change the core_version_requirement to >=10.3 in the 2.x branch and cut a new release sooner rather than later, so that this doesn't prevent sites from updating to Drupal 10.3

    I am a maintainer, but do not have permission to create new releases, so another of the maintainers will need to be involved.

    Increasing the priority to "Major."

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    Clarification: based on testing, the change introduced here does not introduce BC problems with prior versions of Drupal core. Rather, this change is required for compatibility with Drupal 10.3 and above.

    Therefore, I think we just need to cut a new release -- no change to the core_version_requirement.

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

    Thanks @johnlutz and @mark_fullmer! I encountered this issue after upgrading to 10.3.0, and MR12 worked. A new release would be great to avoid needing a patch or using the dev version.

    @nightlife2008, can you help with releasing version 2.1.0?

  • πŸ‡ΊπŸ‡ΈUnited States luke.leber Pennsylvania

    Hey @millerrs - we're working toward a 2.1.0 release. There's an ongoing discussion right now that has to be resolved first.

  • Status changed to Needs work 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States luke.leber Pennsylvania

    Following up here - this is what I get on Drupal 10.1 when attempting to run a drush cr on a site with 2.x:

    www-data@5bae608a62be:~/html$ drush cr
    
    In YamlFileLoader.php line 161:
                                                                                                                                                                                                                              
      The configuration key "autoconfigure" cannot be used to define a default value in "modules/contrib/media_library_form_element/media_library_form_element.services.yml". Allowed keys are "public", "tags", "autowire".  
    

    I think we may have to declare ^10.3 only here?

  • Status changed to Fixed 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States luke.leber Pennsylvania

    Opened drupal.org/project/media_library_form_element/issues/3457129 as a follow-up; re-closing :-)

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

Production build 0.71.5 2024