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

Created on 21 April 2023, almost 2 years 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

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pcate

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

Merge Requests

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 almost 2 years ago
    9 pass
  • @pcate opened merge request.
  • Status changed to Needs review almost 2 years 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 almost 2 years 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.

  • First commit to issue fork.
  • Merge request !18Update media_files_handler.info.yml β†’ (Open) created by EthanT
Production build 0.71.5 2024