Composer installs this module despite no dependency is given on it

Created on 21 January 2025, about 1 month ago

Problem/Motivation

Today I ran a composer update on a codebase that is using "drupal/tour_ui" as a dependency. That tour_ui module itself seems to have a dependency to core's tour module (declared as "drupal:tour" in the info.yml file, no composer.json is given).

However composer installed this contrib module, and I don't know why it did. Running "composer why drupal/tour" printed the information "There is no installed package depending on "drupal/tour"".

Steps to reproduce

Setup a composer based project, require drupal/tour_ui. Run composer update on it. On my installation it then installed "drupal/tour".

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Miscellaneous

Created by

πŸ‡©πŸ‡ͺGermany mxh Offenburg

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

Comments & Activities

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

    Tour_ui is no longer supported and it's functionality is rolled into tour.

  • πŸ‡©πŸ‡ͺGermany mxh Offenburg

    Thanks for the info, but it doesn't answer why Composer is installing this module.

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

    That I can’t say. This module has no reference to tour_ui since that functionality was folded in.

    Would manually search your lock file and see what could be referencing this

  • πŸ‡©πŸ‡ͺGermany mxh Offenburg

    This is in my generated composer.lock file:

            {
                "name": "drupal/tour_ui",
                "version": "2.0.0",
                "source": {
                    "type": "git",
                    "url": "https://git.drupalcode.org/project/tour_ui.git",
                    "reference": "2.0.0"
                },
                "dist": {
                    // ...
                },
                "require": {
                    "drupal/core": "^9.1 || ^10",
                    "drupal/tour": "*"
                },
                "type": "drupal-module",
                "extra": {
                    "drupal": {
                        "version": "2.0.0",
                        "datestamp": "1689967253",
                        "security-coverage": {
                            "status": "covered",
                            "message": "Covered by Drupal's security advisory policy"
                        }
                    }
                },
                "notification-url": "https://packages.drupal.org/8/downloads",
                "license": [
                    "GPL-2.0-or-later"
                ],
                "authors": [
                   // ..
                ],
                "description": "Provides a UI to manage guided tours.",
                "homepage": "https://www.drupal.org/project/tour_ui",
                "support": {
                    "source": "https://git.drupalcode.org/project/tour_ui"
                }
            },

    So tour_ui module depends on it according to composer.lock.
    But the tour_ui module does not even have a composer.json file - neither in the Gitlab repository nor locally when downloaded.
    So that definition must be (wrongly) generated from something else, maybe by the packagist repository.

    Maybe this problem does not occur if tour_ui would have a composer.json defined on its own.
    Moving this to tour_ui as it looks like the problem needs to be addressed from there.

  • πŸ‡©πŸ‡ͺGermany mxh Offenburg
Production build 0.71.5 2024