Problem/Motivation

The project lives at drupal.org/project/dtk and the composer package is drupal/dtk, but the module's machine name in code is drush_dtk. This violates Drupal's naming convention where the project short name, directory name, .info.yml filename, and PSR-4 namespace must all match.

Problem

When installing via Composer (composer require drupal/dtk), the package installs to modules/contrib/dtk/, but the module's .info.yml is named drush_dtk.info.yml. This creates a mismatch:

  • Project/package name: dtk
  • Install directory: modules/contrib/dtk/
  • Module machine name: drush_dtk
  • Expected machine name: dtk

Because Drupal's extension discovery relies on the directory name matching the .info.yml filename, the module won't be found by Drupal after a Composer install unless the directory is manually renamed or Composer is configured with an installer-paths override.

The drush en drush_dtk command in the README won't work out of the box with a standard Composer-managed install — Drupal will look for drush_dtk.info.yml inside a directory named drush_dtk, but the package installs into a dtk directory.

Steps to reproduce

  1. composer require drupal/dtk
  2. drush en drush_dtk
  3. Observe: module not found

Proposed resolution

Rename the module machine name from drush_dtk to dtk:

drush_dtk.info.yml dtk.info.yml
drush_dtk.module dtk.module (if applicable)
Update any service definitions, hook implementations, and the PSR-4 namespace from Drupal\drush_dtk to Drupal\dtk
Update the README installation instructions to drush en dtk
Alternatively, if drush_dtk is the intended machine name, the project short name on drupal.org should be changed to match (i.e., drupal.org/project/drush_dtk), though this is harder to change after initial creation.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork dtk-3609408

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

michaellander created an issue. See original summary.

michaellander’s picture

Title: Use project machine name throughout » Machine name mismatch: module uses drush_dtk but project is dtk
gxleano’s picture

Assigned: Unassigned » gxleano
Priority: Normal » Critical
gxleano’s picture

Thanks Michael to report this issue, I will try to solve this asap

gxleano’s picture

Assigned: gxleano » Unassigned
Status: Active » Needs review

  • gxleano committed 358aec51 on 1.0.x
    Issue #3609408: Fix machine name mismatch
    
marcus_johansson’s picture

Status: Needs review » Fixed

Looks good - getting merge

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

gxleano’s picture

Status: Fixed » Closed (fixed)