Problem/Motivation

This module service minifyjs depends on the file.usage service provided by the core File module, but the module itself does not declare a dependency on the File module causing (under certain circumstances) a PHP fatal when syncing the config or installing a project from the existing config.

PHP error:

In CheckExceptionOnInvalidReferenceBehaviorPass.php line 31:
                                                                                   
  The service "minifyjs" has a dependency on a non-existent service "file.usage". 

Proposed resolution

Add a missing dependence to the module info file

Remaining tasks

Review a patch

User interface changes

None

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Taran2L created an issue. See original summary.

Taran2L’s picture

Taran2L’s picture

Status: Active » Needs review
Taran2L’s picture

So, the patch from #2 does resolve the issue and it applies to the dev version, but it cannot be applied to the stable version ... because Drupal packagist script adds several lines at the bottom of the info file, and due to the missing newline, the patch cannot be applied

name: Minify JS
description: Allows an administrator to minify any javascript file in Drupal and use that version rather than the original.
package: Performance and scalability
type: module
core: 8.x

core_version_requirement: ^8 || ^9
configure: minifyjs.config
# Information added by Drupal.org packaging script on 2020-05-14
version: '8.x-2.1'
project: 'minifyjs'
datestamp: 1589484639

Always add a new line at the end, always!

Taran2L’s picture

FileSize
533 bytes

I've modified the patch by hand, so it should work with the stable 2.1 release

Taran2L’s picture

Nope, patch from #5 won't apply either.

  • slydevil committed 32f0de5 on 8.x-2.x authored by Taran2L
    Issue #3146562 by Taran2L: Missing dependency on the core File module
    
slydevil’s picture

Status: Needs review » Fixed
slydevil’s picture

Status: Fixed » Closed (fixed)