Metapackage of submodule should be more strict on parent package dependency

Created on 21 August 2025, 2 months ago

Problem/Motivation

Today I have encountered an odd situation on a project which had Facets 2 installed.

composer show drupal/facets | grep version
versions : * 2.0.9

I have tried to install drupal/facets_exposed_filters because it was a dependency of another module I tried and was missing - did not realize that this is a submodule of Facets, actually Facets 3.

composer show drupal/facets | grep version
versions : * 2.0.9
❯ ddev composer req drupal/facets_exposed_filters
./composer.json has been updated
Running composer update drupal/facets_exposed_filters
Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking drupal/facets_exposed_filters (3.0.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Installing drupal/facets_exposed_filters (3.0.0)
....
Using version ^3.0 for drupal/facets_exposed_filters

The submodule was installed by Composer but actually it was not:

$ ls web/modules/contrib/facets/modules
facets_range_widget  facets_rest  facets_searchbox_widget  facets_summary

because for actually installing it Facets 2 must have been updated to Facets 3 since facets_exposed_filters only exists in Facets 3.x:

From the attached composer.lock diff it is obvious what happened; it has not been told to Composer to update the parent module ( "drupal/facets": "*",) therefore it left as-is and made no change basically.

Steps to reproduce

Proposed resolution

Metapackage generated for a submodule must lock on the same version of the parent module that bundles it to avoid this unexpected behavior.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Component

Packaging

Created by

πŸ‡­πŸ‡ΊHungary mxr576 Hungary

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

Comments & Activities

  • Issue created by @mxr576
  • πŸ‡ΊπŸ‡ΈUnited States drumm NY, US

    Submodules are tricky for Composer since there isn’t a concept of them in Composer, and the meta packages are indeed a hack.

    Generating version ranges for when a submodule was part of a module would likely end up being a hard problem. The submodule might be removed and re-added later.

Production build 0.71.5 2024