The service "media_files_handler.handler" has a dependency on a non-existent service "file.usage".

Created on 21 April 2023, over 1 year ago
Updated 21 December 2023, 11 months ago

I just tried updating from version 1.0.0-alpha6 to 1.0.0-beta1. When I then try importing the site configuration with a clean Drupal install I get the following error:

In CheckExceptionOnInvalidReferenceBehaviorPass.php line 86:
                                                                                                      
  The service "media_files_handler.handler" has a dependency on a non-existent service "file.usage".  
πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pcate

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

  • Issue created by @pcate
  • πŸ‡ΊπŸ‡ΈUnited States pcate

    From my limited research this error may be because the module's .info file does not specify module dependencies.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    9 pass
  • @pcate opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States pcate

    Created MR for adding the core media module as a dependency. The MR resolved the issue for me.

  • Assigned to maacl
  • Status changed to Needs work over 1 year ago
  • πŸ‡©πŸ‡ͺGermany maacl

    Thanks for the report and the patch, let's see if we can add a test for this.

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

    let's see if we can add a test for this.

    Honestly I'm not sure how to test this. Did you have a specific approach you were thinking of?

  • Issue was unassigned.
  • πŸ‡©πŸ‡ͺGermany maacl
    let's see if we can add a test for this.

    Honestly I'm not sure how to test this. Did you have a specific approach you were thinking of?

    I think it should be possible to install the module in a test, and then it should only pass if the media and file module are enabled also? And currently they won't be enabled because of the missing dependency.

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

    @maacl not sure how useful a test for this is. It seems like it would be testing Drupal module dependency system rather than this module itself. The module has a clear dependency on the core media module that should be declared.

Production build 0.71.5 2024