fix(drupal-contrib): fix drupal_version option order to match drupal-core, fixes #132#144
Merged
Conversation
Member
Author
|
In the PR, for manual testing, suggest this Drupal issue (from the related issue here): https://www.drupal.org/project/skipto/issues/3566898 That has issue fork and branch |
…th drupal-core Options were ordered 11, 12, 10 (default 11) while drupal-core had 12, 11, 10 (default 12). The mismatch caused Coder workspace wizard to install the wrong Drupal version when selecting 12.x. Fixes #132. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ble) 12.x is the main branch, not yet stable. Contrib issue work typically targets the current stable release (11.x), unlike drupal-core where main-branch work is the norm. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ser respects selected version ddev-drupal-contrib's expand-composer-json defaults DRUPAL_CORE to ^11 if the env var is unset. The startup script was not setting it, so ddev poser always installed Drupal 11 regardless of the drupal_version parameter. Use 'ddev dotenv set .ddev/.env.web --drupal-core' after addon install but before ddev start so the container environment carries the right constraint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mposer.json composer require drush/drush without a version lets Composer auto-determine a constraint (e.g. ^13.7) and write it into the module's composer.json. expand-composer-json then copies that pinned constraint into composer.contrib.json. Drush 13.x requires symfony/yaml ^6||^7, which conflicts with Drupal 12's requirement of symfony/yaml ~v8. Using drush/drush:* overrides any existing pinned constraint (including one the module already carries) so Composer can resolve Drush 14.x-dev which supports Symfony 8. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
No Drupal 12 case existed, so the drush/symfony conflict would have passed undetected. skipto targets Drupal 12 in its own composer.json and is a suitable CI canary for D12 contrib compatibility. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Write .git/info/exclude so workspace-generated untracked files (.ddev/, web/, vendor/, scaffold files, recipes/) don't appear in git status. This file is never committed and doesn't touch the module's own .gitignore. Restore composer.json after ddev poser succeeds — drush is now in vendor/ so the require entry is no longer needed and shouldn't show as a local modification. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… files Excluding web/, vendor/, .editorconfig etc. is the module's own .gitignore concern. ddev-drupal-contrib explicitly recommends committing .ddev/ changes, so blanket-excluding .ddev/ conflicts with that philosophy. Only hide the three files that coder-ddev itself generates: .env.web, config.coder.yaml, docker-compose.coder-describe.yaml, and config.local.yaml (themes only). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mposer.json git checkout composer.json removed drush from the file, causing ddev restart to rebuild vendor/ without drush and breaking drush en. Use git update-index --skip-worktree instead: the file content (and drush entry) stays intact so ddev never reinstalls, but git status hides the modification. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…poser require ddev-drupal-contrib README explicitly says to manually add dev dependencies to require-dev rather than using the composer require command. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5177159 to
da7ed06
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two fixes for issue #132 where selecting Drupal 12.x installed Drupal 11.x instead:
Fix 1 — parameter option order: Reorders the `drupal_version` options in `drupal-contrib` from `11 → 12 → 10` to `12 → 11 → 10`, matching `drupal-core`. Coder's workspace wizard carries the selected option by index across steps, so the mismatched order caused index 0 ("12" in drupal-core) to resolve to index 0 ("11" in drupal-contrib). Default remains `11` (current stable), appropriate for contrib work.
Fix 2 — DRUPAL_CORE env var: `ddev-drupal-contrib`'s `expand-composer-json` / `ddev poser` reads a `DRUPAL_CORE` environment variable and defaults to `^11` if unset. The startup script was not setting it, so `ddev poser` always installed Drupal 11 regardless of the parameter. Now calls `ddev dotenv set .ddev/.env.web --drupal-core "^$DRUPAL_VERSION"` after the addon is installed and before `ddev start`, so the container environment carries the correct constraint.
Manual testing
Push the template as an inactive version (no image build needed — config-only change):
Note the new version name from the output (e.g. `sore_hughes16`), then create a test workspace using https://www.drupal.org/project/skipto/issues/3566898, which has both an issue fork and branch and supports Drupal 12:
Once the workspace finishes starting, verify the installed Drupal version:
Clean up when done:
To promote the version once verified:
🤖 Generated with Claude Code