ddev / ddev-drupal-contrib

DDEV integration for developing Drupal contrib projects
Apache License 2.0
91 stars 20 forks source link

Improve documentation on changing the version of Drupal core #75

Closed ptmkenny closed 2 weeks ago

ptmkenny commented 1 month ago

I just tried this addon today, hoping to run phpunit tests on a contrib module using drupal 11.

The README states:

To customize the version of Drupal core, create a config.local.yaml (or [any filename lexicographically after config.contrib.yaml](https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#extending-configyaml-with-custom-configyaml-files)) with contents similar to

But the generated config.contrib.yaml has a comment:

web_environment:
  # If desired, override to a different version of Drupal core in via the project's DDEV config
  - DRUPAL_CORE=^10

This seems to imply that I should edit the config.yaml for the project instead of config.local.yaml, so I was confused as to which file I should modify.

So I tried both-- I created a .ddev/config.local.yaml with the following content:

web_environment:
  - DRUPAL_CORE=^11

Then I ran ddev restart; ddev phpunit. It's still running phpunit 9, so Drupal 11 didn't get installed.

So I tried specifying DRUPAL_CORE=^11 in config.yaml and ddev restart, but I'm getting the same problem.

I tried searching the issue queue but I only found an MR (https://github.com/ddev/ddev-drupal-contrib/pull/46/files), and the README has since been overwritten.

I'd appreciate any insight you can provide into how to enable tests on Drupal 11.

ptmkenny commented 1 month ago

stasadev helped on Discord.

After changing the files, I needed to run ddev poser again. However, that failed because I had PHP 8.2 and Drupal 11 requires PHP 8.3, so then I had to edit the PHP version in config.yaml, run ddev restart to pick up the new version of PHP, and then run ddev poser to get Drupal 11.

I think that which file to change and which commands to run after changing it should be part of the documentation.

rfay commented 1 month ago

Could you do a docs PR? Thanks!

ptmkenny commented 1 month ago

Done here: https://github.com/ddev/ddev-drupal-contrib/pull/76