Custom module with the name of a contrib module falsely identified as a contrib module

Created on 13 October 2023, 9 months ago
Updated 21 February 2024, 4 months ago

This is a tricky one!

I was working on a D9 upgrade project where there was a custom module named identical to an existing Drupal contrib module.

Upgrade status linked incorrectly to the issue queue of the contrib module on Drupal.org as well.

The module was being pulled from a custom composer repository within the organization and was namespaced correctly in composer.json.

I have not dug into the logic on how upgrade_status determines if a module is a contrib or a custom module. I am also not sure of a fool proof way to identify if a custom module named identical to a contrib module on Drupal.org is actually a custom module or the code of the contrib module.

Thought I should put this issue down to at least document this scenario.

On a separate note, isn't there a globally unique identifier that we can generate through packaging that we can use to determine contrib vs core? Sort of like a java namespacing mechanism or something tied to the composer namespacing? What if the module does not have an entry in composer.json? What if a contrib was downloaded and manually added into the contrib folder without a composer.json entry? Can it be something contained within the module folder itself?

๐Ÿ› Bug report
Status

Closed: works as designed

Version

4.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States anoopjohn Washington D. C.

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

Comments & Activities

  • Issue created by @anoopjohn
  • ๐Ÿ‡ญ๐Ÿ‡บHungary Gรกbor Hojtsy Hungary

    Many people get their contrib modules via git and not packaging, so a packaging level solution would not help. Upgrade Status uses Git Deploy and Composer deploy primarily to help identify contrib projects. It also has some basic heuristics on its own.

    I think a module would be classified as contrib if:

    - if has a project key in its info file
    - OR it did not have a project key but git_deploy or composer_deploy identified it as such a put in the project key to the processed info array
    - OR none of the above but its under /contrib/ in the file system (see ProjectCollector.php)

  • Status changed to Closed: works as designed 4 months ago
  • ๐Ÿ‡ญ๐Ÿ‡บHungary Gรกbor Hojtsy Hungary
Production build 0.69.0 2024