Drupal Release: 10.0.0-alpha2
Pre Release
Tag Name: 10.0.0-alpha2
Release Date: 2/18/2022
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 10.0.0-alpha2 represents a significant step in Drupal's evolution toward version 10, focusing on removing deprecated code, improving compatibility with Symfony 6, and enhancing CKEditor 5 integration. This release increases the PHP requirement to 8.1 and includes important security fixes. It's primarily targeted at developers and site builders who want to prepare for the upcoming Drupal 10 release by testing their modules and themes against the new codebase.
Highlight of the Release
- PHP 8.1 is now required for Drupal 10
- Symfony 6 compatibility updates
- Removal of numerous deprecated functions and services
- Enhanced CKEditor 5 integration with improved image handling
- Security fixes including SA-CORE-2022-003 and SA-CORE-2022-004
- Improved toolbar caching for better performance with CSRF tokens
- Removal of SimpleTest support
- Complete removal of deprecated modules like migrate_drupal_multilingual and entity_reference
Migration Guide
PHP Requirements
- Drupal 10 now requires PHP 8.1 or higher. Ensure your hosting environment meets this requirement before upgrading.
Removed Deprecated Code
Numerous deprecated functions and services have been removed. If your custom or contributed modules use any of the following, they will need to be updated:
- Removed deprecated functions from bootstrap.inc, common.inc, file.inc, schema.inc, and update.inc
- Removed deprecated code from Drupal\Core\Routing, Drupal\Component\Utility, and Drupal\Core\Config
- Removed deprecated 'app.root' and 'site.path' services
- Removed deprecated 'cache.null' service
- Removed deprecated feed.reader.* and feed.writer.* services
- Removed deprecated code from module.inc, system.module, comment module, field module, node module, path module, search module, and more
- Removed deprecated code from Drupal\Core\Condition, Drupal\Core\Archiver, and editor module
- Removed deprecated code from asset library system, media system functions, and session namespace
Removed Modules
- The migrate_drupal_multilingual module has been completely removed
- The entity_reference module has been completely removed (use core entity reference fields instead)
Symfony 6 Compatibility
- Drupal 10 now depends on Symfony 6.0
- Services as container parameters are no longer supported
- Return type hints have been added for Symfony 6 compatibility
Theme System Changes
- Removed deprecated theme functions
- Removed drupal_find_theme_functions()
Testing Framework Changes
- Removed SimpleTest support from run-tests.sh, TestDiscovery, and TestRunnerKernel
- Removed SimpletestUiPrinter
- Removed the legacy assert traits
Database Changes
- JSON support is now required for the database in Drupal 10
- PostgreSQL requires the pg_trgm extension to be installed
Entity System Changes
- Removed BC layers in the entity system
Other Changes
- Removed config.autoloader-suffix from composer.json
- Removed per-table prefixing
- Removed core updates added prior to 9.3.0
Upgrade Recommendations
For Developers and Site Builders
Testing Recommendation: This alpha release is intended for testing purposes only and should not be used on production sites. It's recommended that developers and site builders set up test environments to evaluate compatibility with their custom and contributed modules.
PHP Requirements: Ensure your development and testing environments are running PHP 8.1 or higher, as this is now required for Drupal 10.
Module Compatibility: Test all contributed and custom modules for compatibility with this alpha release. Pay special attention to modules that might be using deprecated code that has been removed in this version.
Symfony 6 Compatibility: If you have custom code that interacts directly with Symfony components, ensure it's compatible with Symfony 6.
Database Requirements: Verify that your database system supports JSON functionality, which is now required. PostgreSQL users should ensure the pg_trgm extension is installed.
For Module Maintainers
Code Updates: Review your modules for usage of any deprecated functions or services that have been removed in this release. The migration guide section provides a comprehensive list of removals.
Testing: Test your modules thoroughly against this alpha release to identify and fix any compatibility issues before the stable release of Drupal 10.
Documentation: Update your module documentation to reflect any changes required for Drupal 10 compatibility.
Upgrade Path
As this is an alpha release, direct upgrades from production Drupal 9 sites are not recommended. Instead, use this release to test and prepare for the eventual stable release of Drupal 10. The recommended approach is to:
- Clone your production site to a development environment
- Update to the latest Drupal 9 release
- Test the upgrade to Drupal 10.0.0-alpha2
- Identify and fix any compatibility issues
- Wait for the stable release of Drupal 10 before upgrading production sites
Bug Fixes
CKEditor and Media Handling
- Fixed issue where CKEditor 5's toolbar would occlude Drupal's toolbar when focused
- Fixed media library widget forgetting ordering when adding or removing items
- Fixed file links with query parameters no longer working
- Fixed compatibility issues with inline form errors
- Fixed issue where
<img width>upcast assumed HTML5 px unit but HTML4 allowed % unit
System and Core Fixes
- Fixed issue where update.module was incorrectly only responding when modules were installed
- Fixed issue where Element::properties() produced notices if given an array with integer keys
- Fixed wrong argument for @message in ModuleInstaller::install call to watchdog_exception
- Fixed unused variable $unpublished in TrackerTest.php
- Fixed issue where wide-image class was incorrectly added for user pictures
- Fixed undefined variables where files are included
- Fixed database dumps no longer being driver-agnostic
- Fixed issue where fuzzed tag values to EntityAutocompleteController::handleAutocomplete caused deprecation warnings
- Fixed issue where #type => 'toolbar_item' without a tab triggered a deprecation notice on PHP 8.1
- Fixed issue where users with passwords over 60 characters could not log in via the user login block
New Features
Enhanced CKEditor 5 Integration
- Fixed toolbar positioning so it no longer occludes Drupal's toolbar when CKEditor 5 has focus
- Added support for alignment on
<drupal-media>elements - Added image resizing capabilities through the imageresize plugin
- Improved handling of image width attributes during upcast (now supports % units)
- Added API for contrib projects to load CKEditor translations
- Fixed translation of toolbar button tooltips when text part language plugin is enabled
Improved Developer Experience
- Added a more generic API that supplies frontend metadata about media entities
- Refactored HTMLRestrictionsUtilities to a HtmlRestrictions value object
- Enhanced toolbar's subtree caching for better handling of menu links with CSRF tokens
- Added Nightwatch tests for toolbar functionality
- Improved error messaging when PostgreSQL is used without the pg_trgm extension
Better User Interface
- Moved Status report near the top of the Reports menu for better visibility
- Improved visual error indicators for text fields using CKEditor 5
- Enhanced keyboard accessibility in edge cases
Security Updates
Security Advisories
- Included SA-CORE-2022-003 security fix (cherry-picked from commit 8fabbc611e0987aab2c2247aee0885e79e21ab1f)
- Included SA-CORE-2022-004 security fix (cherry-picked from commit 0ea69dc824f56f1cbeb38103e3fa4718832cc109)
Security Improvements
- Updated Twig to version 2.14.11 to address security concerns
- Improved handling of CSRF tokens in toolbar caching
- Fixed potential security issues in file handling
Performance Improvements
Toolbar Caching Improvements
- Enhanced Toolbar's subtree caching so that menu links with CSRF tokens do not need one subtree cache item per session, significantly reducing cache entries and improving performance
Code Optimization
- Refactored array_merge() usage in loops for better performance
- Simplified code in assets.js by removing mix of await and promise code
- Avoided unnecessary installs when testing JSON:API on config entities
- Optimized CKEditor 5 off-canvas CSS reset
Database Improvements
- Removed per-table prefixing for better database performance
- Added a kernel test for Connection::hasJson to ensure proper functionality
Impact Summary
Drupal 10.0.0-alpha2 represents a significant milestone in the development of Drupal 10, focusing on removing deprecated code, improving compatibility with modern dependencies, and enhancing core functionality. This release increases the PHP requirement to 8.1 and updates to Symfony 6, signaling Drupal's commitment to staying current with modern web technologies.
The most impactful changes in this release are the extensive removals of deprecated code, functions, and services across numerous subsystems. These removals will require developers to update custom and contributed modules that rely on this deprecated functionality. Modules like migrate_drupal_multilingual and entity_reference have been completely removed, requiring sites using these modules to find alternatives.
CKEditor 5 integration has seen substantial improvements, including better toolbar positioning, enhanced image handling with support for alignment and resizing, and improved accessibility. These changes will benefit content editors by providing a more seamless editing experience.
Security has been strengthened with the inclusion of two security advisories and an update to Twig 2.14.11. Performance improvements include enhanced toolbar caching and optimized code in various areas.
This alpha release is primarily targeted at developers and site builders who want to prepare for the upcoming Drupal 10 release by testing their modules and themes against the new codebase. It's not recommended for production sites but serves as an important testing milestone for the Drupal community to ensure a smooth transition to Drupal 10 when it's officially released.
Statistics:
User Affected:
- Need to update code that relies on deprecated functions and services that have been removed
- Must ensure compatibility with PHP 8.1 which is now required
- Need to adapt to Symfony 6 compatibility changes
- Should review CKEditor 5 integration changes if working with text editors
- Need to update any code that relied on removed modules like migrate_drupal_multilingual and entity_reference
