Drupal 8 Updates
There are no exclusions at this time.
Composer allows us to peg modules and dependencies at specific versions. We do this to ensure that updates are not applied unless we specifically request them. These are common formats for versions of Drupal core and its modules.
Core release 8.5.3 = composer require --no-update drupal/core:8.5.3
Module anchor_link release 8.x-1.6 = composer require --no-update drupal/anchor_link:1.6
Module twig_tweak 8.x-2.0 = composer require --no-update drupal/twig_tweak:2.0
Alpha / Beta / RC Releases
Module block_field 8.x-1.0-alpha5 = composer require --no-update drupal/block_field:1.0-alpha5
Module media_entity_audio 8.x-1.0-beta3 = composer require --no-update drupal/media_entity_audio:1.0-beta3
Module diff 8.x-1.0-rc1 = composer require --no-update drupal/diff:1.0-rc1
Generally, we want to avoid pegging to a development release, however this is sometimes necessary if we need to apply a patch which will only apply cleanly to the dev branch or if a module maintainer has committed a critical patch, but has not released a stable tagged release. Whenever we use a dev release, we should get the hash of the commit we've tested against and include it in the composer requirements. This prevents composer from downloading commits past that hash.
Module olark 8.x-1.x-dev = compooser require --no-update drupal/olark:1.x-dev#940ab50528b683c12ca6208daec06d38899b883a
Module token_language 8.x-1.x-dev = composer require --no-update drupal/token_language:1.x-dev#489c8ca30d165b6aaeba3e5dc65bd17b967a8b54
- Adding module via composer involves first telling composer to add the module to composer.json while not performing other updates:
composer require --no-update drupal/MODULE_NAME:VERSION
- Next we tell composer to rebuild the composer.lock file with any dependencies, and install the odule and its dependencies:
composer update --with-dependencies nothing
Running "composer install" will install everything listed in the composer.lock file and not make any updates to it or the composer.json. This is useful after a "git pull" to install any new dependencies.
- Go to https://www.middlebury.edu/institute/admin/reports/updates and click on Check Manually to fetch the latest version information. The settings on the Institute site are configured to check for all modules, including those disabled on the site.
- cd ~/private_html/institute
- git pull
- Create a new branch to test the module updates, based on the master branch.
- git checkout --track -b updates-20180601
- git push -u origin updates-20180601
- For each module:
- composer require --update-with-dependencies drupal/MODULE_NAME:VERSION (see the Versions section above)
- If you receive as error such as: "Could not apply patch! Skipping."
- Check the module's dev log to see if the named patch was incorporated into the new release
- If so, you can remove the patch from composer.json and run composer require again.
- Check to ensure that only the module and composer files were changed using git status.
- git add composer.*
- git add -A web/modules/contrib/MODULE_NAME
- git commit -m "MODULE_NAME: Upgraded module from OLD_VERSION to NEW_VERSION. For #NNN."
- "NNN" is the number of the issue in Github for updating the modules this week.
- Update the Weekly Updates Post with "Drupal MODULE_NAME NEW_VERSION" linking to the releases page on drupal.org.
- Check whether the module updates require database schema changes:
- drush8 -y updatedb
- If the module requires schema changes, do not deploy it until scheduled downtime on Thursday morning.
- git checkout master
- git merge --no-ff -m "Fix #NNN updates." updates-20180601
- git push
- Follow the Drupal 8 Deployment process. Make sure to use the -c flag.