Problem/Motivation

The project page currently instructs users to install the module using:

composer require 'drupal/webform_bootstrap-webform_bootstrap:^1.0'

However, this package name is confusing and non-standard for Drupal modules.
The Git repository for this project does not include a composer.json, which results in Drupal.org packaging generating a synthetic Composer package name:

drupal/webform_bootstrap-webform_bootstrap

This differs from the expected convention:

drupal/webform_bootstrap

and may cause confusion for users and maintainers.

Steps to reproduce

Visit project page: https://www.drupal.org/project/webform_bootstrap

Follow Composer install instructions shown.

Note that the package name differs from standard Drupal naming conventions and from the project machine name.

Proposed resolution:
Add a proper composer.json file to the project repository with:

{
"name": "drupal/webform_bootstrap",
"type": "drupal-module",
"description": "Bootstrap styling integration for Webform module"
}

This will allow Drupal.org packaging to publish the module under the standard package name:

drupal/webform_bootstrap

Comments

smulvih2 created an issue. See original summary.

  • joseph.olstad committed 61c9990d on 1.0.x
    fix: #3574442 Add a composer.json file to resolve non-standard package...
joseph.olstad’s picture

Title: Composer install instructions reference non-standard package name and cause confusion » Add a composer.json file to resolve non-standard package name
Status: Active » Fixed

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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

mably’s picture

Has the problem really been fixed?

I haven't been able to install 1.0.1.

joseph.olstad’s picture

Ok so no, its probably not fixed. Do this instead:
composer require 'drupal/webform_bootstrap-webform_bootstrap:^1.0'

mably’s picture

Here is Claude explanation, not verified it but seems plausible:

Why composer require drupal/webform_bootstrap-webform_bootstrap looks weird

It is a name-collision artefact on drupal.org's packagist, not a typo. There are two packages on packages.drupal.org claiming the "webform_bootstrap" name:

drupal/webform_bootstrap — type: metapackage, 194 versions (latest 6.3.0-beta9)
A stub that just requires drupal/webform: * and drupal/core: ^10.3 || ^11.0. It is the legacy alias for the old sub-module that used to live inside the Webform contrib project.
drupal/webform_bootstrap-webform_bootstrap — type: drupal-module, 2 versions (1.0.0, 1.0.1)
The actual standalone module published on drupal.org/project/webform_bootstrap.

How we got here

The webform_bootstrap code originally shipped as a sub-module bundled inside webform/webform, at webform/modules/webform_bootstrap/. Drupal.org's packagist auto-generates a drupal/{submodule_machine_name} alias for every sub-module of every contrib project, so drupal/webform_bootstrap was minted as a metapackage that just pulls in the parent drupal/webform — and it inherits the whole 6.x version line of Webform (hence the 194 versions and the 6.3.0-beta9 latest).

Webform 6.4.x dropped the bundled webform_bootstrap sub-module. Someone then created a standalone replacement project at drupal.org/project/webform_bootstrap to restore that behaviour for Webform 6.4+.

When the packagist generator processed the standalone project, the obvious name drupal/webform_bootstrap was already taken by the legacy metapackage alias. Drupal.org's generator falls back to the drupal/{project_machine_name}-{module_machine_name} form when there is a collision, hence drupal/webform_bootstrap-webform_bootstrap. The standalone project's own composer.json actually declares name: drupal/webform_bootstrap, but the packagist generator ignores that field and uses its own derived name.

Practical impact

  • composer require drupal/webform_bootstrap-webform_bootstrap:^1.0 is correct and gets you the new standalone module.
  • composer require drupal/webform_bootstrap is the legacy alias and pulls in drupal/webform — only useful on Webform 6.3 and earlier, where the sub-module still exists.
  • Sites migrating from Webform 6.3 to 6.4+ must change their composer.json line accordingly.
liam morland’s picture

I don't think the require section of composer.json should be there.

  • The requirement for drupal/core is handled automatically based on core_version_requirement.
  • The dependency on drupal/webform should not be needed because it is fine to install this along side Webform 6.3.x. Doing so removes a warning from the status page.

As it is, this can result in the installation of 6.x branch instead of a stable tag.

joseph.olstad’s picture

Status: Closed (fixed) » Active

Ok @liam_morland , I think this commit will satisfy.

joseph.olstad’s picture

Title: Add a composer.json file to resolve non-standard package name » Add a composer.json file
Status: Active » Fixed

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.

  • joseph.olstad committed 26ece223 on 1.0.x
    fix: #3574442 Add a composer.json - adjustment.
    
    By: smulvih2
    By: joseph...

  • joseph.olstad committed 3f4300a3 on 1.0.x
    fix: #3574442 Add a composer.json - adjustment merge.
    
    By: smulvih2
    By:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.