Every release of a major Drupal version is a big event in the Drupal community. It has always been a reason to celebrate. But developers, clients and marketers are also anxious about the challenges they may face during the upgrading process.
Recently, there has been quite a buzz in the Drupal community about the release of Drupal 9 on June 3, 2020. The community is also trying to support Drupal 7 and Drupal 8.
Letâs Get Ready for the Drupal 9 Upgrade
As per the official documentation, Drupal 9 will be a cleaned-up version of Drupal 8. Similar to the last Drupal 8 minor version, deprecated code will be removed, and third-party dependencies will be updated.
Drupal 9 = Drupal 8 - (Deprecated code cleanup + Updated third-party dependency)
Code in Drupal is marked as "deprecated" when it should no longer be used. Typically, code is deprecated because there is a better alternative that should be used instead. Upgrading from Drupal 8 to Drupal 9 should be easy if the use of deprecated code is being checked regularly and removed upon detection.
How to Know If a Site Uses a Deprecated Code
The following three tools can be used to check if your site is using a deprecated code:
- Drupal-check: This static PHP code analysis tool developed by Matt Glaman can be used to check your codebase for deprecated code.
Here is a video which explains the use of drupal-check:
You can automate this process by making it an integral part of your development workflow. A docker image contributed by Hussain Abbas is worth mentioning here.
- Upgrade Status: This is a contributed module by Acquia which scans the code of contributed and custom projects you may have installed, and reports on any deprecated code that needs to be replaced.
- BLT: If your project is based on BLT, it is exciting to know that the deprecated code check is now part of BLT 10, and will now be available as other validation check.
- 44 percent of the modules have no deprecation warnings.
- The remaining 56 percent of the modules need to be updated.
- The majority of modules have less than 3 deprecated warnings.
If you are planning to upgrade your Drupal 8 version then it is the right time to start cleaning your codebase by removing any deprecated code. Once your codebase is free of deprecated code, your upgrade to Drupal 9 will be as easy as a minor version upgrade.