Drupal Release: 8.0-alpha7
Pre Release
Tag Name: 8.0-alpha7
Release Date: 12/18/2013
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-alpha7 brings significant improvements to the development of Drupal 8, focusing on code cleanup, performance optimization, and architectural enhancements. This release removes numerous unused variables, converts legacy code to new-style Form objects and Controllers, improves the Views module functionality, enhances multilingual support, and refines the entity API. Key highlights include replacing superglobals with the Symfony Request object, improving in-place editing, and adding caching to the state system. This alpha release continues to solidify Drupal 8's foundation as a modern, object-oriented CMS framework.
Highlight of the Release
- Replaced most remaining superglobals with Symfony Request object
- Added caching to the state system for improved performance
- Enhanced in-place editing with better error handling
- Improved Views module with better block integration and exposed filters
- Converted legacy code to new-style Form objects and Controllers
- Refined entity API with better field handling and translation support
- Removed numerous unused variables throughout the codebase
- Enhanced multilingual support for content and configuration
Migration Guide
Superglobals Replacement
Code that uses PHP superglobals ($_GET, $_POST, etc.) should be updated to use the Symfony Request object instead. This is a significant change that affects many custom modules and themes.
// Old code
$value = $_GET['parameter'];
// New code
$value = $request->query->get('parameter');
Form API Changes
Forms should be converted to use the new Form interface:
// Old procedural style
function my_module_form($form, &$form_state) {
// Form definition
return $form;
}
// New object-oriented style
namespace Drupal\my_module\Form;
use Drupal\Core\Form\FormBase;
class MyModuleForm extends FormBase {
public function getFormId() {
return 'my_module_form';
}
public function buildForm(array $form, FormStateInterface $form_state) {
// Form definition
return $form;
}
public function submitForm(array &$form, FormStateInterface $form_state) {
// Form submission handling
}
}
Entity API Changes
- Field instance bundle is now accessible directly on the bundle property
- Field definitions no longer use the "Field" prefix in method names
- Field instance YAML files can now refer to fields by field name rather than field_uuid
Theme System Changes
theme_system_powered_by()has been removeddrupal_add_css()anddrupal_add_js()have been removed from various subsystems; use#attachedinstead
Controller Conversion
Many page callbacks have been converted to controllers. If you're extending or overriding these, you'll need to update your code to use the new controller-based approach.
Upgrade Recommendations
For Site Builders
This is an alpha release and is not recommended for production sites. It's suitable for developers who want to test and contribute to Drupal 8's development. If you're testing this release, be prepared for significant changes in future releases.
For Developers
If you're actively developing for Drupal 8, this alpha release provides important architectural improvements that you should incorporate into your modules and themes. Pay special attention to:
- Replacing superglobals with the Symfony Request object
- Converting forms to the new Form interface
- Using the updated entity API and field system
- Leveraging the service container instead of global functions
For Module Maintainers
Begin updating your modules to work with these changes, particularly:
- The new Form and Controller interfaces
- Changes to the entity and field systems
- Removal of global functions in favor of services
Testing Recommendation
While this is an alpha release, thorough testing is encouraged to identify bugs and issues before the beta release. Focus on testing:
- Multilingual functionality
- Entity creation, editing, and deletion
- Form submissions
- Views configuration and display
Bug Fixes
Entity and Field System
- Fixed
getDefaultValue()failing with ConfigurableEntityReferenceFieldItemList - Fixed CommentManager attempting to get fields for config entity types
- Fixed issues with field translatability not being properly switched
- Fixed field_language() returning NULL for non-configurable fields
- Fixed entity cache inconsistencies when saving/deleting entities
- Fixed issues with multiple comment fields per entity breaking when using pagers
Multilingual Support
- Fixed content admin views title being saved localized to the menu table
- Fixed multilingual node search bugs with title and language filtering
- Fixed "Undefined index: und in ContentEntityBase->language()" error when installing in foreign languages
- Fixed translation update for uninstalled modules and themes
Form and UI Issues
- Fixed form token validation for anonymous users
- Fixed disabling form fields on comments
- Fixed autocomplete textfield with AJAX where tab key fired AJAX before setting autocomplete value
- Fixed inability to select 'Default' view mode for custom blocks
- Fixed Views exposed forms that were broken
- Fixed changing view access from 'Permission' to 'Role' causing AJAX errors
New Features
Enhanced In-place Editing
The in-place editing system has been significantly improved with better error handling. If an AJAX request to commit changes fails, users now have recovery options. Additionally, when multiple instances of the same entity appear on a page, all instances are now properly updated when one is edited.
Improved Views Integration
- Views blocks now allow users to set block instance titles directly in the Block UI
- Added reset button functionality to the admin/content exposed filters
- Converted several core blocks to Views, including "Who's new" block
- Added ability to specify route names for path-based views
Dynamic Routes
A new system allows dynamic routes to be defined via callbacks, providing more flexibility in the routing system.
New Process Plugins for Migration
Several new process plugins have been added to the migration system:
- Iterator process plugin
- Entity deduplication process plugin
- Static map process plugin
- Machine name process plugin
Security Updates
No specific security fixes were mentioned in the release notes. This alpha release primarily focuses on code cleanup, architectural improvements, and bug fixes rather than security issues.
Performance Improvements
State System Caching
Added caching to the state system, which significantly improves performance by reducing database queries for frequently accessed state values.
Doctrine Annotation Optimization
Improved Doctrine annotation parsing to reduce the amount of time and memory required during installation, which was previously taking an unacceptable amount of resources.
Entity System Improvements
Removed non-storage logic from storage controllers, leading to cleaner separation of concerns and better performance when working with entities.
Views Performance
Several improvements to Views processing and rendering have been implemented, including better handling of aggregation settings and more efficient AJAX processing.
Impact Summary
Drupal 8.0-alpha7 represents a significant step forward in the development of Drupal 8, focusing on code cleanup, architectural improvements, and bug fixes. This release removes hundreds of unused variables, converts legacy code to modern object-oriented patterns, and enhances key subsystems like Views, entities, and multilingual support.
The most impactful changes include replacing PHP superglobals with the Symfony Request object, adding caching to the state system, improving in-place editing, and refining the entity API. These changes collectively move Drupal 8 closer to a modern, service-oriented architecture with cleaner, more maintainable code.
For developers, this release requires significant adaptation to new patterns and APIs, particularly around forms, controllers, and entity handling. Module maintainers will need to update their code to work with these changes. Site builders and content editors will benefit from improved Views functionality, better multilingual support, and enhanced in-place editing.
While this is still an alpha release not intended for production use, it provides a clearer picture of Drupal 8's architecture and sets the stage for more stable beta releases in the future.
Statistics:
User Affected:
- Benefit from cleaner code with removal of unused variables and improved coding standards
- Need to adapt to new Form interfaces and Controller patterns
- Must update code that relied on superglobals to use Symfony Request object
- Can leverage new plugin systems and service-based architecture
