Drupal Release: 9.0.0-alpha2
Pre Release
Tag Name: 9.0.0-alpha2
Release Date: 3/4/2020
DrupalHighly flexible, open-source content management system known for complex, scalable web applications. Preferred by government, educational, and large enterprise websites requiring advanced customization and security features. Robust module ecosystem.
TL;DR
Drupal 9.0.0-alpha2 represents a significant step in Drupal's evolution, focusing on removing deprecated code and preparing for compatibility with newer dependencies like Symfony 5 and PHPUnit 8. This release removes the SimpleTest module, eliminates numerous deprecated APIs, improves theme architecture by decoupling from Classy, enhances Layout Builder functionality, and addresses various bugs. It's a crucial milestone for developers to test their code against Drupal 9 compatibility as the platform moves toward more modern PHP practices and dependencies.
Highlight of the Release
- Removal of SimpleTest module from core
- Support for PHPUnit 8 in Drupal 9
- Removal of numerous deprecated APIs and BC layers
- Decoupling core themes from Classy
- Improved Layout Builder functionality
- Enhanced update status reporting
- Updated JavaScript libraries (CKEditor 4.13.1, Popper.js 2.0.0, SortableJS 1.10.2)
- Better handling of bundle-specific routes
- Improved cache metadata handling
Migration Guide
for Drupal 9.0.0-alpha2
Removed Modules
- SimpleTest Module: Completely removed from core. Use PHPUnit for testing instead.
- Place Blocks Module: Removed. Use Block Layout or Layout Builder instead.
- Entity Reference Module: Uninstalled and prevented from being enabled again.
Deprecated Code Removal
-
AllowedTagsXssTrait: Removed this deprecated trait.
-
Entity System: Removed BC layers from the entity system, including:
- Revision metadata keys BC layer
$baseThemesBC layer from\Drupal\Core\Theme\ActiveThemeisSubclassOf()method from EntityTypeInterface
-
Component Cleanup: Removed all deprecated code from:
- Asset component
- Config component
- Datetime component
- Field component
- Form component
- Menu Link Content module
- Migrate module
Theme System Changes
- Core themes (Bartik, Seven, etc.) no longer use Classy as a base theme
- Moved HTML classes from preprocess functions to templates
- Properly deprecated theme functions for Drupal 10
- Removed deprecated jQuery UI library definitions
- Decoupled Stable libraries from Bartik/Seven/Claro/Umami
JavaScript Updates
- Re-scheduled removal of deprecated JavaScript code to Drupal 10
- Updated CKEditor to version 4.13.1
- Updated Popper.js to 2.0.0
- Updated SortableJS to 1.10.2
Other Important Changes
- Removed Symfony's classloader as it does not exist in Symfony 4
- Removed
\Drupal\Core\Messenger\LegacyMessenger - Properly deprecated
\Drupal\Core\StringTranslation\TranslationWrapper - Removed deprecated
REQUEST_TIMEconstants (moved to Drupal 10) - Removed deprecated services in core.services.yml
- Removed deprecated
DRUPAL_PHP_FUNCTION_PATTERN - Removed deprecated
configDirectoriesproperty from FunctionalTestSetupTrait
Required Actions
- Update any code using removed deprecated APIs
- Test modules and themes with PHPUnit 8
- Update theme templates that previously depended on Classy
- Review code using jQuery UI libraries
- Update any code using removed BC layers in the Entity system
- Replace uses of
REQUEST_TIMEwith the Time service - Update any code using deprecated theme functions
Upgrade Recommendations
Who Should Upgrade
This alpha release (9.0.0-alpha2) is not recommended for production sites. It is intended for:
- Module and theme developers who need to test and update their code for Drupal 9 compatibility
- Contributors who want to help identify and fix bugs in the Drupal 9 codebase
- Site builders who want to begin testing their custom code against Drupal 9
Upgrade Path
If you're currently on Drupal 8:
- First upgrade to the latest Drupal 8.9.x release
- Use the Upgrade Status module to identify compatibility issues in your custom code and contributed modules
- Fix any identified compatibility issues
- When Drupal 9.0.0 stable is released, follow the standard minor version upgrade process
Timing Recommendation
- For production sites: Wait for the stable release of Drupal 9.0.0
- For development/testing environments: This alpha release provides a good opportunity to begin testing and updating custom code for Drupal 9 compatibility
Technical Considerations
- Ensure your hosting environment supports PHP 7.3 or higher
- Test with PHPUnit 8 compatibility
- Review any custom code that might be using deprecated APIs that have been removed
- Pay special attention to custom themes that might depend on Classy
- Check for any modules that might depend on SimpleTest or Place Blocks modules
Tools to Help
- Use the Upgrade Status module to scan your site for Drupal 9 compatibility issues
- Use Drupal Check to analyze your custom code for deprecated API usage
Bug Fixes
-
Layout Builder Improvements:
- Fixed issue where Layout Builder did not correctly bubble up cache metadata for empty blocks
- Fixed form blocks rendered inside Layout Builder breaking save functionality
- Fixed entity reference field blocks not bubbling cache metadata when view access to referenced entity is not allowed
-
Migration Fixes:
- Fixed
<nolink>menu items being lost on migration - Fixed handling of comment "language" column that might be empty after migrating from D6 to D7
- Fixed
-
Theme and UI Fixes:
- Fixed Bartik template incorrectly referencing Claro library
- Fixed "Add a new inline block" title on settings tray not matching "Custom block"
- Fixed issue with Page Title block on homepage
-
Entity System Fixes:
- Fixed issue where taxonomy terms could not be rendered when in preview
- Fixed issue when updating an entity type from non-revisionable to revisionable if it has non-revisionable fields stored in dedicated tables
-
Other Fixes:
- Fixed FinishResponseSubscriber adding empty Vary-headers on non-cacheable responses
- Fixed Log::findCaller failing to report the correct caller function with non-core drivers
- Fixed issue with installing modules from .zip URLs
- Fixed issue where creating a Page View with a leading slash resulted in a double-slash
- Fixed incorrect documentation for RouteProvider::getRouteByName()
- Fixed DrupalDateTime::$formatTranslationCache not being an array
New Features
and Enhancements
-
Protocol Version Cache Context: Added a new cache context to optimize responses for HTTP/1 vs HTTP/2, allowing for better performance optimization based on the protocol used.
-
Bundle-Specific Routes: Made defining bundle-specific routes easier, simplifying the creation of custom routes for specific entity bundles.
-
EntityAutocompleteMatcherInterface: Added a new interface to improve entity autocomplete functionality.
-
Improved Update Status Reporting:
- Better handling of security coverage information in status reports
- Improved usability of core compatibility ranges on available updates report
- Better recommendations when no recommended update is found
-
JavaScript Library Updates:
- Updated CKEditor to version 4.13.1
- Updated Popper.js to version 2.0.0
- Updated SortableJS to version 1.10.2
-
Migration Improvements:
- Added support for migrating Drupal 7 menu language content settings
- Improved handling of body fields when no equivalent filter is found during migration
-
Nightwatch Enhancements: Added support for install profile and language code parameters in drupalInstall Nightwatch command.
Security Updates
No specific security fixes were mentioned in the commit messages for this alpha release. As this is an alpha version, the focus appears to be on removing deprecated code, improving architecture, and preparing for compatibility with newer dependencies rather than addressing security issues.
Security improvements will likely be more prominent in beta and stable releases as the codebase stabilizes.
Performance Improvements
-
Cache Optimization: Added a new "protocol version" cache context to allow optimizing responses for HTTP/1 vs HTTP/2, which can lead to better performance by tailoring responses to the capabilities of each protocol.
-
Media Source Handling: Improved how media sources handle empty source field values, making the system more graceful and efficient when dealing with incomplete media data.
-
APCU Cache Limits: Added warnings when the hosting environment has a too low limit of APCU cache, helping administrators optimize their cache settings for better performance.
-
Cache Metadata Handling: Multiple improvements to how cache metadata is bubbled up in various components, including Layout Builder blocks and entity reference fields, ensuring more accurate cache invalidation and better performance.
Impact Summary
Drupal 9.0.0-alpha2 represents a significant step in the evolution of Drupal, focusing primarily on removing deprecated code and preparing for compatibility with newer dependencies like Symfony 5 and PHPUnit 8. This release has substantial impact on developers who will need to update their code to work with the cleaned-up APIs.
The removal of SimpleTest module marks a complete transition to PHPUnit for testing. Theme developers will need to adapt to core themes no longer using Classy as a base theme, which changes how themes inherit markup and styling. The elimination of numerous deprecated APIs and BC layers in the Entity system, Config component, and other core areas means that any code relying on these deprecated elements will need to be updated.
For site builders, the removal of the Place Blocks module and improvements to Layout Builder functionality represent a shift toward more modern site building tools. The enhanced update status reporting provides clearer information about compatibility and security coverage.
Module maintainers face the most significant impact, as they'll need to ensure their modules are compatible with the removed deprecated code and updated dependencies. The re-scheduling of some deprecations to Drupal 10 (like JavaScript code) provides some breathing room, but the overall direction is clear: Drupal is moving toward more modern PHP practices and dependencies.
This alpha release is an important milestone for testing code against Drupal 9 compatibility, but it's not recommended for production sites. The changes reflect Drupal's commitment to staying current with modern web development practices while providing a clear upgrade path from Drupal 8.
Statistics:
User Affected:
- Need to update code that uses deprecated APIs that have been removed
- Must adapt to the removal of SimpleTest module
- Should test modules and themes for compatibility with PHPUnit 8
- Need to update any code relying on removed BC layers in the Entity system
- Should review code using jQuery UI as those libraries are now removed
