Discussion: Move Media/Media Library support to separate module

Created on 5 January 2022, over 2 years ago
Updated 16 October 2023, 9 months ago

Problem/Motivation

When enabling Webprofiler (Devel module) with Gutenberg enabled but with Media Library disabled, an error is thrown:
PHP Fatal error: Interface 'Drupal\media_library\MediaLibraryOpenerInterface' not found in /var/www/html/web/modules/custom/gutenberg/src/MediaLibraryGutenbergOpener.php on line 16
My suspicion is Webprofiler is doing some kind of class discovery for enabled modules but not sure, needs to be checked.
My concern is if any other module does the same thing or this kind of functionality gets into core in the future.
But another use/edge case would be if someone needs Media and/or Media Library but doesn't want it on Gutenberg - currently Gutenberg checks if Media and Media Library are enabled and automatically "uses" it.

This issue is open to discussion and, for now, it has a minor priority.

Steps to reproduce

Install and enable Gutenberg
Install and enable Devel and Webprofiler

Proposed resolution

Move Media/Media Library support to separate module (Gutenberg sub-module) with proper dependencies.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡΅πŸ‡ΉPortugal marcofernandes

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡―πŸ‡΅Japan tyler36 Osaka

    Encounted this on side project.

    Gutenberg installs fine on fresh Drupal 10.1.5
    However, if a site already has webprofile installed and enabled, the error displays.

  • πŸ‡―πŸ‡΅Japan tyler36 Osaka

    Workaround:

    1. Disable webprofiler

    $ drush pmu webprofiler
     [success] Successfully uninstalled: webprofiler
    

    2. Enable media_library

    $ drush en media_library -y
    [success] Successfully enabled: media_library
    

    1. Enable webprofiler

    $ drush en webprofiler -y
     [success] Successfully enabled: webprofiler
    
Production build 0.69.0 2024