Home

>

Tools

>

Drupal

>

Releases

>

11.2.0-alpha1

Drupal Release: 11.2.0-alpha1

Pre Release

Tag Name: 11.2.0-alpha1

Release Date: 5/12/2025

Drupal LogoDrupal

Highly 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 11.2.0-alpha1 introduces significant enhancements to the admin experience, including a new Navigation module with improved UI, SDC component variants, and HTMX integration. This release focuses on modernizing Drupal's frontend with reduced jQuery dependencies, improved accessibility, and better performance through optimized caching and database operations. It also introduces important developer improvements with attribute-based hooks replacing annotations, enhanced validation constraints, and better testing infrastructure.

Highlight of the Release

    • New Navigation module with improved UI for managing site navigation
    • HTMX integration for building interactive interfaces with less JavaScript
    • SDC component variants for more flexible component design
    • Administration theme now used by default when editing or creating content
    • Attribute-based hooks replacing annotations for better performance
    • Enhanced validation constraints for configuration entities
    • Improved accessibility with better ARIA attributes and heading structures
    • Optimized caching and database operations for better performance

Migration Guide

Upgrading to Drupal 11.2.0-alpha1

Attribute-based Hooks

If you're using custom module hooks, consider migrating to the new attribute-based system:

// Old way
function mymodule_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  // Form alter logic
}

// New way
use Drupal\Core\Form\FormAlterAttribute;

#[FormAlter]
function mymodule_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  // Form alter logic
}

Deprecated Features

Several features have been deprecated and will be removed in future versions:

  1. Annotations for Plugins: Replace with attributes where possible

    // Old way
    /**
     * @Block(
     *   id = "my_block",
     *   admin_label = @Translation("My block")
     * )
     */
    
    // New way
    #[Block(
      id: "my_block",
      admin_label: new TranslatableMarkup("My block")
    )]
    
  2. node_mark: Use alternative methods for tracking node read status

  3. NodePreviewController::title: Use alternative methods for node preview titles

  4. #type fieldgroup: Use alternative field grouping methods

  5. Update Manager: Renamed to "Update Status", update references accordingly

  6. NodeStorage::updateType: Remove type change handling in NodeType::postSave

  7. RendererInterface::render()'s $is_root_call parameter: Adjust render calls accordingly

Configuration Changes

If you're using custom configuration schemas, ensure they comply with the new validation constraints added in this release. Review your configuration entities against the new validation rules, especially for:

  • Menu configurations
  • File configurations
  • Entity form modes
  • Block settings

JavaScript Changes

  1. jQuery Reduction: Several components now use less jQuery. If you depend on jQuery events from these components, update your code accordingly.

  2. HTMX Integration: If you want to leverage the new HTMX integration, familiarize yourself with HTMX patterns and usage.

  3. VanillaJS Replacements: Contextual Links now use VanillaJS instead of BackboneJS. If you extended this functionality, update your code accordingly.

Upgrade Recommendations

For Development Sites: We recommend upgrading to Drupal 11.2.0-alpha1 for development and testing environments to evaluate the new features and identify any potential issues with your custom code or contributed modules.

For Production Sites: As this is an alpha release, it is not recommended for production sites. Wait for the stable release before upgrading production environments.

Before Upgrading:

  1. Create a complete backup of your site's files and database
  2. Review deprecated features and update your custom code accordingly
  3. Test contributed modules for compatibility with this release
  4. Check custom themes for compatibility with the new frontend changes
  5. Review custom JavaScript that might be affected by jQuery reductions

Upgrade Steps:

  1. Update your composer.json to require Drupal 11.2.0-alpha1
  2. Run composer update drupal/core --with-all-dependencies
  3. Run database updates via Drush (drush updatedb) or the update.php script
  4. Clear caches (drush cache:rebuild or through the admin interface)
  5. Test thoroughly, especially features related to:
    • Content editing workflows
    • Media Library functionality
    • Custom forms and form alters
    • Menu management
    • Any custom JavaScript functionality

Post-Upgrade:

  1. Review logs for any errors or warnings
  2. Test all critical site functionality
  3. Consider adopting new features like attribute-based hooks and HTMX integration
  4. Update your development practices to align with the new approaches introduced in this release

Bug Fixes

Media Library Fixes

  • Fixed issue where Media Library's current selection was not reset properly
  • Fixed styling issues that assumed contextual module was present

Menu and Navigation Fixes

  • Fixed issue where <front> menu links were missing active trail classes
  • Fixed contextual links disappearing intermittently
  • Fixed issue where deleting a menu link from the node edit form did not apply hook_ENTITY_TYPE_access()

Form and UI Fixes

  • Fixed issue where users were able to block themselves from Drupal
  • Fixed issue where block plugins didn't store their context mappings on submit
  • Fixed issue where the aria-pressed attribute wasn't updated correctly
  • Fixed dialog close icon contrast with forced-colors

Content Management Fixes

  • Fixed issue where node access table could be left in inconsistent state
  • Fixed issue where node add/edit gave a "Call to a member function getAccountName() on null" when author is NULL
  • Fixed issue where the Content overview page filtered out unpublished nodes when a node access module was enabled

Cache and Performance Fixes

  • Fixed issue with lazy builder broken (#type defaults not loaded)
  • Fixed optimization of placeholder retrieval from cache
  • Fixed optimization of redirect chain retrieval in VariationCache

Other Fixes

  • Fixed issue where a profile without a version caused a fatal error on status report page
  • Fixed issue where user module sent email containing HTML entities
  • Fixed issue where workspace manage page did not allow for pager-less list of changes
  • Fixed issue where translations were created in Live workspace

New Features

New Navigation Module

The new Navigation module provides an improved UI for managing site navigation with better organization and customization options.

HTMX Integration

Drupal now includes HTMX as a core dependency, enabling developers to build interactive interfaces with less JavaScript and better performance.

SDC Component Variants

Single Directory Components now support variants, allowing for more flexible and reusable component design with different variations of the same component.

Administration Theme for Content Editing

The administration theme is now used by default when editing or creating content, providing a more consistent experience for content editors.

Attribute-based Hooks

A new attribute-based hooks system replaces annotations for better performance and maintainability, including:

  • #[Hook] attribute for general hooks
  • #[FormAlter] attribute for form alter hooks

Enhanced Validation Constraints

New validation constraints have been added:

  • AtLeastOneOf constraint to validate that at least one of the specified fields has a value
  • Improved validation for configuration entities

'Is empty (NULL)' and 'Is not empty (NOT NULL)' Filter Operators

Views now includes these additional filter operators for fields, providing more flexibility in filtering content.

Security Updates

Security Improvements

  • Added tests for SA-CORE-2024-006 to ensure security fixes are properly tested
  • Removed srcdoc attributes in Xss::filter() to prevent potential XSS vulnerabilities
  • Upgraded asm89/stack-cors to prevent loss of Vary header values, which could lead to security issues
  • Improved validation for file uploads by checking for new files when validating size
  • Enhanced security of HTML filtering and sanitization processes
  • Fixed potential security issues in menu link access control

Performance Improvements

Caching Optimizations

  • Preloading cache tags in cache getMultiple for better performance
  • Optimized placeholder retrieval from cache
  • Optimized redirect chain retrieval in VariationCache
  • Recursively replace placeholders in CachedStrategy for better performance

Database Optimizations

  • Introduced a StatementBase abstract class for better database performance
  • Optimized ConfigEntity based lists with items containing non-ascii characters
  • Improved performance of configuration management operations
  • Optimized ViewsViewsData to avoid loading all actions multiple times unnecessarily

JavaScript Performance

  • Reduced jQuery usage in dialog.ajax.js
  • Replaced Array.prototype.forEach.call usages with more efficient alternatives
  • Replaced Contextual Links BackboneJS usage with VanillaJS equivalent for better performance

Build and CI Improvements

  • Using FF_USE_FASTZIP to speed up composer/yarn cache network transfers
  • Improved test performance by preventing setup tasks running for tests that are always skipped
  • Better PHPStan performance with improved baseline handling

Impact Summary

Drupal 11.2.0-alpha1 represents a significant step forward in Drupal's evolution, focusing on modernizing the frontend experience, improving developer workflows, and enhancing performance.

The introduction of the Navigation module provides a more intuitive interface for managing site navigation, while the new HTMX integration opens up possibilities for building interactive interfaces with less JavaScript. For developers, the shift toward attribute-based hooks represents a major architectural improvement that will make code more maintainable and performant.

Content editors will benefit from the administration theme now being used by default when editing or creating content, providing a more consistent experience. The enhanced Media Library and improved accessibility features also contribute to a better content management experience.

Performance improvements are substantial, with optimized caching strategies, more efficient database operations, and reduced JavaScript overhead. These changes should result in faster page loads and better overall site performance.

The addition of SDC component variants gives theme developers more flexibility in creating reusable components, while the reduced jQuery dependencies make it easier to build modern, lightweight themes.

This release also includes numerous bug fixes addressing issues with menu management, content editing, and UI components, making the overall Drupal experience more stable and reliable.

For developers planning to upgrade, the migration to attribute-based hooks and adapting to the deprecated features will require some effort, but the improvements in performance and maintainability make this investment worthwhile.

Statistics:

File Changed300
Line Additions13,221
Line Deletions26,599
Line Changes39,820
Total Commits250

User Affected:

  • Improved administration experience with the new Navigation module providing better UI for managing site navigation
  • Enhanced field management with modals in field creation and edit flows
  • Better content management with administration theme now used by default when editing or creating content
  • Improved Media Library functionality with fixes for selection issues and better styling

Contributors:

larowlanlauriiilongwavealexpott