Drupal Release: 8.0.0-beta5
Pre Release
Tag Name: 8.0.0-beta5
Release Date: 1/27/2015
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 8.0.0-beta5 brings significant improvements to the development framework with a focus on entity handling, performance optimization, and code modernization. This release includes important bug fixes for entity display, field handling, and caching mechanisms. Key highlights include the introduction of link fields for storing URIs rather than URLs, improved JavaScript handling with default footer placement, and enhanced template inheritance with Twig. The update also features numerous code cleanups, API improvements, and security enhancements that strengthen Drupal's foundation as it moves closer to a stable release.
Highlight of the Release
- Link fields now store URIs rather than URLs/paths/routes for better flexibility and compatibility
- JavaScript is now placed in the footer by default, with options to force placement in the header when needed
- Added Twig template inheritance based on the theme registry for more powerful theming
- Improved entity reference handling with selection plugins decoupled from field definitions
- Enhanced caching with better tag handling and optimization for high-latency networks
- Converted translation metadata into regular entity fields for better multilingual support
- Added SVG version of the Drupal logo as the default logo format
- Fixed numerous issues with Views filters, fields, and relationships
- Improved security with better HTTP_HOST header validation
- Enhanced dependency injection throughout the system with proxy services for lazy loading
Migration Guide
Link Field Changes
If you're using link fields in your custom code, you'll need to update your implementation to work with URIs rather than URLs/paths/routes. The LinkItem schema has been changed to store URIs, which provides better flexibility but requires updates to any code that directly interacts with link field data.
// Old way
$entity->field_link->url = 'node/1';
// New way
$entity->field_link->uri = 'entity:node/1';
JavaScript Placement
JavaScript is now placed in the footer by default. If you have JavaScript that needs to be in the header, you'll need to explicitly specify this in your library definition:
my_library:
js:
js/my-script.js: { header: true }
Entity Reference Selection
Entity reference selection plugins have been decoupled from field definitions. If you've implemented custom entity reference selection logic, you'll need to update your code to use the new plugin system:
// Old way
$selection_handler = \Drupal::service('plugin.manager.entity_reference.selection')->getSelectionHandler($field_definition);
// New way
$selection_handler = \Drupal::service('plugin.manager.entity_reference_selection')->getInstance([
'target_type' => 'node',
'handler' => 'default',
'handler_settings' => [],
]);
Deprecated Functions Removed
Several deprecated functions have been removed:
format_plural()- Use thet()function with the@countplaceholder insteadlanguage_list()- Use the language manager service insteadtaxonomy_vocabulary_load()and related functions - Use entity API methods insteadlist_themes()and_system_rebuild_theme_data()- Use the theme handler service instead
Route Names in Entity Annotations
Entity annotations now use link templates instead of route names. Update your custom entity type annotations:
// Old way
* links = {
* "canonical" = "entity.my_entity.canonical",
* "edit-form" = "entity.my_entity.edit_form"
* }
// New way
* links = {
* "canonical" = "/my-entity/{my_entity}",
* "edit-form" = "/my-entity/{my_entity}/edit"
* }
Upgrade Recommendations
This beta release contains significant improvements and bug fixes that move Drupal 8 closer to a stable release. If you're already running Drupal 8 beta 4, upgrading to beta 5 is strongly recommended to benefit from the numerous bug fixes and performance improvements.
For developers working with custom modules and themes:
- Review your code for any usage of deprecated functions that have been removed
- Update any custom entity types to use the new link templates format
- Check your JavaScript placement and update library definitions if needed
- Review any custom link field implementations to ensure compatibility with the new URI storage format
For site builders:
- Test your Views configurations thoroughly after upgrading, as several Views-related bugs have been fixed
- Review any complex entity reference configurations to ensure they work correctly with the updated selection system
- Test multilingual functionality if you're using it, as several translation-related issues have been fixed
This is still a beta release, so it's recommended to thoroughly test your site after upgrading and before deploying to production. Make sure to back up your database and files before upgrading.
Bug Fixes
Entity Display Issues
Fixed incorrect schema for EntityDisplay third_party_settings, ensuring proper storage and retrieval of display settings.
Views Filter and Field Problems
- Fixed issues with Views combined filters adding redundant separators
- Resolved problems with fields not being 'click sortable' in views
- Fixed bug where removed fields in Views Combined Filter settings led to fatal errors
- Fixed issue where table format combine fields into single column showed only one field
Form Validation and Submission
- Fixed comment field settings not saving properly
- Resolved issues with feed entity validation missing form validation logic
- Fixed shortcut content entity validation missing form validation logic
CKEditor and Text Editor Issues
- Fixed text editor configuration UI not updating correctly when switching editors
- Resolved issues with CKEditor translating its user interface even when interface translation is turned off
- Fixed font size issues in CKEditor
Caching Problems
- Fixed issue where caches dependent on simple config were only invalidated on form submissions
- Resolved problem where views fields with attached assets were lost when Views output caching was enabled
Multilingual and Translation Bugs
- Fixed configuration translations not updating when manually importing a .po file
- Resolved issue where content translation operation was only available for nodes, not other entity types
Security and Access Issues
- Fixed bulk operations not respecting entity access
- Resolved issue where user role permission assignments were not deleted when a role was deleted
UI and Display Problems
- Fixed node form layout bug when toolbar collapsed
- Resolved issue where Ajax call breaks Password Reset
- Fixed double escaped string on Available translation update page
New Features
Enhanced Link Field Implementation
Link fields now store URIs rather than URLs/paths/routes, providing better flexibility and compatibility across different contexts. This change improves how links are handled throughout the system.
Default JavaScript Footer Placement
All JavaScript is now placed in the footer by default, with options to force placement in the header when needed. This improves page load performance by allowing the browser to render content before processing scripts.
Twig Template Inheritance
Added Twig template inheritance based on the theme registry, enabling more powerful and flexible theming capabilities. This allows theme developers to create more modular and reusable template structures.
Lazy Service Instantiation
Implemented proxy services for lazy loading of service dependencies, improving performance by only instantiating services when they're actually needed.
SVG Default Logo
Changed the default logo filetype to SVG and added an SVG version of Druplicon, providing better scaling and display across different devices and resolutions.
Entity Collection Template
Added an entity collection template for lists, providing a standardized way to display collections of entities.
Reusable Color Classes
Created reusable color classes for consistent styling across the system, making it easier to maintain a cohesive visual design.
Twig Extension for File URLs
Provided a Twig extension for file_create_url, making it easier to generate file URLs in templates.
Security Updates
HTTP_HOST Header Validation
Improved security by implementing proper validation of the HTTP_HOST header, which cannot be trusted directly. This helps prevent HTTP Host header attacks that could potentially lead to security vulnerabilities.
User Permission Handling
Fixed an issue where user role permission assignments were not being properly deleted when a role was deleted, which could potentially leave lingering permissions in the system.
Entity Access Control
Fixed a bug where bulk operations were not respecting entity access controls, ensuring that users can only perform actions on entities they have permission to access.
Form Validation Security
Enhanced form validation for various entity types including comments, shortcuts, and feeds to ensure proper validation occurs before processing form submissions.
Configuration Security
Improved handling of configuration file name collisions which were previously silently ignored for default configuration, potentially leading to security issues.
Performance Improvements
JavaScript Optimization
JavaScript is now placed in the footer by default, allowing browsers to render content before processing scripts, which improves perceived page load times. This change also includes options to force placement in the header when needed for specific functionality.
Optimized AJAX Page State
The ajaxPageState system has been optimized to keep Drupal 8 sites fast on high-latency networks. This prevents CSS/JS aggregation from taking down sites and uses HTTP GET for AJAX requests where appropriate, reducing overhead.
Lazy Service Instantiation
Implemented proxy services for lazy loading of service dependencies using ProxyManager. This allows for more efficient resource usage by only instantiating services when they're actually needed rather than loading everything upfront.
Route Enhancer Optimization
Fixed an issue where all route enhancers were being run on every request, which was causing unnecessary processing overhead. The system now only runs the relevant enhancers.
Cache System Improvements
- Improved cache tag handling for better invalidation
- Enhanced the cache backend implementation for more efficient storage and retrieval
- Fixed issues with cache invalidation for configuration-dependent items
Entity Loading Optimization
Fixed issues with entity loading for relationships on the same entity type, improving performance when working with complex entity relationships in Views and other contexts.
Impact Summary
Drupal 8.0.0-beta5 represents a significant step forward in the development of Drupal 8, with a strong focus on improving the underlying architecture and fixing critical bugs. This release enhances the developer experience through better entity handling, improved JavaScript management, and more powerful theming capabilities with Twig template inheritance.
The changes to link fields, storing URIs rather than URLs, provide greater flexibility and compatibility across different contexts. This fundamental change, along with the decoupling of entity reference selection plugins from field definitions, demonstrates Drupal's commitment to building a more robust and flexible content management framework.
Performance improvements are substantial, with JavaScript now placed in the footer by default and the implementation of lazy service instantiation through proxy services. These changes, combined with optimizations to the AJAX page state and caching systems, should result in faster page loads and better overall performance, especially on high-latency networks.
Security has been enhanced with better HTTP_HOST header validation and fixes to entity access control in bulk operations. The numerous bug fixes across Views, forms, CKEditor, and multilingual functionality address many pain points reported by the community.
For developers and site builders, this release requires attention to the migration guide, particularly regarding link fields, JavaScript placement, and entity reference selection. However, the improvements in code organization, API consistency, and overall stability make this update well worth the effort.
Overall, Drupal 8.0.0-beta5 demonstrates significant progress toward a stable release, with improvements that benefit developers, site builders, content editors, and end users alike.
Statistics:
User Affected:
- Entity handling improvements with better field storage and display mechanisms
- New link field implementation storing URIs rather than URLs/paths/routes
- Enhanced Twig template inheritance based on theme registry
- Improved JavaScript handling with default footer placement and asset optimization
- Better dependency injection and service container configuration options
