Process also dev releases of modules installed with composer

Created on 17 September 2021, over 3 years ago
Updated 1 February 2023, almost 2 years ago

Problem/Motivation

At the moment, the module is unable to process dev releases, as it requires the project property in the module's info.yml, which is only added by Drupal.org when creating a tar file, and is not available when installing a dev release with composer.

Steps to reproduce

  1. Add a n.x-dev release of a module to a site.
  2. Visit the unused modules page. A message will be shown with an error.

Proposed resolution

Since this only happens with composer, it should be possible to use the composer autoloader classes to find out the name of the package that owns the info.yml file being processed, and use that package name (minus "drupal/") as the project name.

Care should be taken to not break the module for those not using composer.

Remaining tasks

Implement it.

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡΅πŸ‡ΉPortugal jcnventura

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany chr.fritsch πŸ‡©πŸ‡ͺπŸ‡ͺπŸ‡ΊπŸŒ

    Improved the composer handling a bit if your package doesn't is in the drupal/ namespace

    • ndf β†’ committed d6aeb41a on 8.x-1.x
      #3236260 Process also dev releases of modules installed with composer by...
  • πŸ‡³πŸ‡±Netherlands ndf Amsterdam

    Thanks guys,
    on commit I changed the logic a little bit so that submodules of packages are reported correctly.

    Tested:
    - composer require drupal/paragraphs -> all submodules in report
    - composer require non-drupal package -> not in report
    - composer require drupal package, but overridden (local development unused module) -> not in report

    The following composer:

    "require": {
        "php": "~8.1.0",
        "composer/installers": "^1.9",
        "cweagans/composer-patches": "^1.7",
        "danielstjules/stringy": "^3.1",
        "drupal/admin_toolbar": "^3.3",
        "drupal/asset_injector": "dev-2.x",
        "drupal/core": "^9.5",
        "drupal/core-composer-scaffold": "^9.5",
        "drupal/paragraphs": "1.x-dev",
        "drupal/unused_modules": "*",
        "drush/drush": "^11.0",
        "vlucas/phpdotenv": "^5.1",
        "webflo/drupal-finder": "^1.2"
    },
    "repositories": {
        "unused_modules": {
            "type": "path",
            "url": "/Users/ndf/WebWork/DrupalModules/unused_modules"
        },
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    },
    

    The result:

    08:55 $ drush um modules all
     [warning] Message: Could not parse Composer information for module 'unused_modules'
    
    +----------------------------+-----------------------------------+----------------+-----------------------------+--------------------------------------------+
    | Project                    | Module                            | Module enabled | Project has Enabled Modules | Project Path                               |
    +----------------------------+-----------------------------------+----------------+-----------------------------+--------------------------------------------+
    | _NO_PROJECT_INFORMATION_   | unused_modules                    | Yes            | Yes                         |                                            |
    | admin_toolbar              | admin_toolbar                     | Yes            | Yes                         | modules/contrib/admin_toolbar              |
    | admin_toolbar              | admin_toolbar_links_access_filter | No             | Yes                         | modules/contrib/admin_toolbar              |
    | admin_toolbar              | admin_toolbar_search              | No             | Yes                         | modules/contrib/admin_toolbar              |
    | admin_toolbar              | admin_toolbar_tools               | Yes            | Yes                         | modules/contrib/admin_toolbar              |
    | asset_injector             | asset_injector                    | No             | No                          | modules/contrib/asset_injector             |
    | entity_reference_revisions | entity_reference_revisions        | No             | No                          | modules/contrib/entity_reference_revisions |
    | paragraphs                 | paragraphs_demo                   | No             | No                          | modules/contrib/paragraphs                 |
    | paragraphs                 | paragraphs_library                | No             | No                          | modules/contrib/paragraphs                 |
    | paragraphs                 | paragraphs_type_permissions       | No             | No                          | modules/contrib/paragraphs                 |
    | paragraphs                 | paragraphs                        | No             | No                          | modules/contrib/paragraphs                 |
    +----------------------------+-----------------------------------+----------------+-----------------------------+--------------------------------------------+
    
    
  • Status changed to Fixed almost 2 years ago
  • πŸ‡³πŸ‡±Netherlands ndf Amsterdam
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024