Drupal Release: 9.2.0-beta1
Pre Release
Tag Name: 9.2.0-beta1
Release Date: 5/20/2021
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.2.0-beta1 brings significant improvements to the Olivero theme, enhances accessibility, updates key dependencies (jQuery 3.6.0, CKEditor 4.16.0), adds security features like Google FLoC blocking, and includes numerous bug fixes and performance optimizations. This release focuses on improving the user experience with better keyboard navigation, mobile responsiveness, and UI refinements while preparing for future compatibility with Symfony 6.
Highlight of the Release
- Olivero theme improvements for accessibility and mobile experience
- Updated jQuery to version 3.6.0 and CKEditor to 4.16.0
- Added Permissions-Policy header to block Google FLoC tracking
- Replaced jQuery Joyride with a more modern tour solution
- Enhanced security advisory data display for Drupal
Migration Guide
for Drupal 9.2.0-beta1
JavaScript Updates
- jQuery 3.6.0: If you have custom JavaScript that relies on specific jQuery behavior, test thoroughly as jQuery 3.6.0 includes some changes from previous versions.
- jQuery Joyride Replacement: The jQuery Joyride library used for tours has been deprecated and replaced. If you have custom tour implementations, you may need to update them to work with the new tour system.
PHP Code Changes
- Class Aliases: A new class_aliases.php file has been added and then merged into bootstrap.inc. If you were directly including bootstrap.inc, be aware of this change.
- Symfony Compatibility: Code has been updated to prepare for Symfony 6 compatibility. The method
KernelEvent::isMasterRequest()is now deprecated in favor ofisMainRequest(). - ContextDefinition Changes:
ContextDefinition::create()can no longer be used with an entitytype-specific datatype (like entity:user). Update your code to use the appropriate data type.
Theme Updates
- Olivero Theme: If you're using the Olivero theme, numerous improvements have been made to keyboard navigation, mobile experience, and tabledrag interface. Test your site thoroughly, especially if you have customized the theme.
- Toolbar Template: The toolbar.html.twig template has been removed as issue #3174422 is fixed. If you were overriding this template, you'll need to update your code.
API Changes
- ModuleInstallerInterface: The
uninstall()method documentation has been updated to indicate thatModuleUninstallValidatorExceptioncan be thrown. Ensure your code handles this exception if you're programmatically uninstalling modules. - Migration API: Source count caching has been fixed for SqlBase-based source plugins. If you have custom migration plugins, test them with this update.
Testing
- Several tests have been converted from functional to kernel tests. If you were extending these tests, you may need to update your test code.
- Assertions using
assertEqual()have been replaced withassertEquals(). Update your custom tests accordingly.
Upgrade Recommendations
Who should upgrade?
- Development and testing sites: This beta release is recommended for development and testing environments to help identify any issues before the final 9.2.0 release.
- Production sites: As this is a beta release, it is not recommended for production sites. Wait for the final 9.2.0 release unless you specifically need features or fixes in this version and are prepared to handle potential issues.
Upgrade path
- From Drupal 9.1.x: Direct upgrade to 9.2.0-beta1 is possible. Follow the standard minor version upgrade process.
- From Drupal 9.0.x or earlier: It's recommended to first upgrade to 9.1.x before moving to 9.2.0-beta1.
- From Drupal 8.x: Ensure you're on the latest version of Drupal 8.9.x before attempting to upgrade to 9.2.0-beta1.
Before upgrading
- Create a complete backup of your site's files and database
- Update all contributed modules to versions compatible with Drupal 9.2.x
- Review your custom code for compatibility with updated dependencies (jQuery 3.6.0, CKEditor 4.16.0)
- Test the upgrade process on a staging environment first
After upgrading
- Run update.php to apply any pending database updates
- Clear all caches to ensure new code is properly loaded
- Test all critical site functionality, especially forms, JavaScript interactions, and theme elements
- Check for any deprecation notices in your logs that might indicate code that needs updating
Special considerations
- If using the Olivero theme, test thoroughly as many improvements have been made to this theme
- If you have custom tour implementations, test them with the new tour system that replaces jQuery Joyride
- Review your site's JavaScript for compatibility with jQuery 3.6.0
Bug Fixes
Critical Bug Fixes
- Fixed exception when creating an entity reference field targeting an entity type without an ID (#2608750)
- Fixed fatal error when passing non-existing ID to entity parameter converter (#3210372)
- Fixed race condition when generating sub directories for image styles (#3211936)
- Fixed undefined static method Drupal\Core\Database\Connection::serialize() (#3210888)
- Fixed error in statistics_tokens() when calling getTotalCount() on bool (#3190820)
UI and Theme Fixes
- Fixed paragraph format dropdown in body field having extra left spacing (#3212281)
- Fixed AggregatorFeedBlock::build to always return array (#3212354)
- Fixed breadcrumb issue where $title could be an array but Link() requires a string (#3163487)
- Fixed toolbar.html.twig template issues (#3208000)
Migration and Update Fixes
- Fixed DbDumpCommand failures when data type is not a mapped Drupal schema field name (#3210913)
- Fixed issue with getting translations for localized vocabularies in d6/TermLocalizedTranslation.php (#3193189)
- Fixed mapping of Link module's field formatters from D7 to D8/D9 (#3212539)
Testing and Code Quality Fixes
- Fixed CKEditorLoadingTest::testExternalStylesheets() by converting to kernel test (#3211474)
- Fixed \Drupal\Tests\system\Functional\Common\UrlTest by converting to kernel test (#3211480)
- Fixed FormTest::testRequiredFields() failure with radios elements (#588438)
- Fixed cspell issues in core modules (#3212521, #3212547)
- Converted CommentActionsTest to kernel test (#2742997)
New Features
Olivero Theme Improvements
- Enhanced keyboard navigation: Focused level-2 nav items now always remain in viewport during keyboard navigation (#3190120)
- Mobile experience improvements: Fixed submenu closing issues when users attempt to scroll on mobile (#3211897)
- Tabledrag interface improvements: Ensured tabledrag UI is usable within Olivero (#3191725)
- Skip link focus improvements: Fixed layout shift issues when skip links receive focus (#3153265)
- IE11 compatibility: Fixed content layout issues in 33/33/33 layouts (#3212704)
- JavaScript improvements: Normalized selectors in scripts.es6.js (#3212998)
Security and Privacy Enhancements
- Google FLoC blocking: Added Permissions-Policy header to prevent Google's FLoC tracking technology (#3209628)
- Security advisory data: Added functionality to display relevant Security Advisories data for Drupal (#3041885)
UI Improvements
- Custom block library: Added 'Reset' button on Custom block library page (#3207405)
- Responsive image sorting: Responsive image field formatter list now sorted by label instead of machine name (#3107130)
- Umami profile: Removed warning about the Umami profile on the install screen (#2938803)
Developer Tools
- Tour functionality: Deprecated and replaced jQuery Joyride with a more modern solution (#3051766)
- Migration improvements: Fixed source count caching for SqlBase-based source plugins (#3190815)
- Help system: Improved fallback text when generating links to non-existent help topics (#3213022)
Security Updates
Security Enhancements
-
Google FLoC Protection: Added Permissions-Policy header to block Google's Federated Learning of Cohorts (FLoC) tracking technology (#3209628). This helps protect site visitors' privacy by preventing Chrome from including your site in its FLoC calculations.
-
Security Advisory Data: Added functionality to display relevant Security Advisories data for Drupal (#3041885), making it easier for site administrators to stay informed about security issues affecting their sites.
-
Dependency Updates: Updated several dependencies to their latest secure versions:
- CKEditor updated to version 4.16.0 (#3211599)
- jQuery updated to version 3.6.0 (#3211601)
- Other JavaScript dependencies updated for Drupal 9.2 (#3210633)
-
Error Handling Improvements: Fixed several issues that could potentially lead to security vulnerabilities:
- Fixed fatal error when passing non-existing ID to entity parameter converter (#3210372)
- Fixed exception handling when creating entity reference fields (#2608750)
- Fixed race condition when generating sub directories for image styles (#3211936)
Performance Improvements
Cache Optimization
- Locale cache improvements: Reduced cache variations in locale cache system (#3184527), which should decrease cache storage requirements and improve performance for multilingual sites
- Migration source caching: Fixed source count caching for SqlBase-based source plugins (#3190815), eliminating unnecessary cache I/O operations
JavaScript Optimizations
- Updated jQuery: Upgraded to jQuery 3.6.0 (#3211601), which includes performance improvements over previous versions
- Sortable library: Updated Sortable to 1.13.0 (#3191649), providing better performance for drag-and-drop operations
- Tour functionality: Replaced jQuery Joyride with a more modern solution (#3051766), reducing JavaScript overhead
Code Efficiency
- Route serialization: Fixed route serialization incompatibilities between PHP 7.4 and 7.3 (#3145563), improving routing performance
- Account emails: Fixed missing newlines in account emails due to malformed YAML (#3212034), improving email processing efficiency
- Missing view reporting: Improved error reporting for missing views in preRenderViewElement() (#2868258), reducing debugging time
Impact Summary
Drupal 9.2.0-beta1 represents a significant step forward in Drupal's evolution, focusing on accessibility, user experience, and modernization of dependencies. The release brings substantial improvements to the Olivero theme, making it more accessible and mobile-friendly with better keyboard navigation, improved submenu behavior, and fixed layout issues.
Security and privacy enhancements are a key focus, with the addition of a Permissions-Policy header to block Google's FLoC tracking and improved display of security advisory data. These changes help site administrators better protect their users' privacy and stay informed about security issues.
The update to modern dependencies, including jQuery 3.6.0 and CKEditor 4.16.0, ensures Drupal remains compatible with current web standards while preparing for future compatibility with Symfony 6. The replacement of jQuery Joyride with a more modern tour solution demonstrates Drupal's commitment to modernizing its codebase.
Performance improvements in cache handling, particularly for locale cache and migration source caching, will benefit multilingual sites and those performing migrations. These optimizations reduce unnecessary cache I/O operations and decrease cache storage requirements.
For developers, the release includes numerous bug fixes, improved error handling, and code quality enhancements. The fixes for entity reference fields, parameter converters, and image style generation address critical issues that could cause errors in certain scenarios.
Content editors will appreciate the UI improvements, including better paragraph formatting, enhanced mobile experience, and improved keyboard navigation. The addition of a 'Reset' button on the Custom block library page and better sorting of responsive image field formatters enhance the administrative experience.
Overall, this beta release demonstrates Drupal's continued commitment to accessibility, security, performance, and developer experience, setting the stage for a robust 9.2.0 final release.
Statistics:
User Affected:
- Benefit from improved UI for custom block library with new 'Reset' button
- Can now view security advisory data for Drupal
- Better protection against Google FLoC tracking for site visitors
- Improved tabledrag interface in Olivero theme
