Home

>

Tools

>

Drupal

>

Releases

>

8.0-alpha5

Drupal Release: 8.0-alpha5

Pre Release

Tag Name: 8.0-alpha5

Release Date: 11/19/2013

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 8.0-alpha5 represents a significant milestone in Drupal 8's development with major architectural improvements and code organization. This release focuses on enhancing the plugin system, improving field management, modernizing the codebase by removing deprecated functions, and strengthening accessibility. Key changes include moving Widget, Formatter, and FieldType plugin types to Core\Field system, implementing entity-level language fallback, integrating CSRF protection directly into the routing system, and adding configuration translation UI. The release also improves performance with better caching mechanisms and enhances the developer experience through code cleanup and standardization.

Highlight of the Release

    • Moving Widget, Formatter, and FieldType plugin types to the Core\Field system for better organization
    • Switching from field-level language fallback to entity-level language fallback
    • Adding configuration translation user interface module
    • Integrating CSRF link token directly into routing system
    • Implementing #post_render_cache callback to allow for personalization without breaking the render cache
    • Converting contextual links to a plugin system similar to local tasks/actions
    • Improving accessibility in multiple areas including CKEditor toolbar, status messages, and overlay close button
    • Adding support for alt, title, width and height for default images
    • Allowing single config files to be imported and exported

Migration Guide

Updating Plugin References

Developers need to update code that references Widget, Formatter, and FieldType plugins to use the new Core\Field system:

// Old way
use Drupal\field\Plugin\Type\Widget\WidgetInterface;

// New way
use Drupal\Core\Field\WidgetInterface;

Service Container Changes

Replace any remaining drupal_container() calls with Drupal::service():

// Old way
$service = drupal_container()->get('service_name');

// New way
$service = \Drupal::service('service_name');

Language Fallback

Update code that uses field-level language fallback to use entity-level language fallback:

// Old approach (field-level fallback)
$field_items = $entity->getTranslation($langcode)->get($field_name);

// New approach (entity-level fallback)
$entity = $entity->getTranslation($langcode);
$field_items = $entity->get($field_name);

Entity Render Controller

Update any references to EntityRenderController to use EntityViewBuilder:

// Old way
$render_controller = entity_get_render_controller('node');

// New way
$view_builder = \Drupal::entityManager()->getViewBuilder('node');

String Escaping

Update code that uses check_plain() to use \Drupal\Component\Utility\String::checkPlain() directly:

// Old way
$safe_string = check_plain($string);

// New way
$safe_string = \Drupal\Component\Utility\String::checkPlain($string);

Routing and Redirects

Update controllers to use route-based redirects:

// Old way
$form_state['redirect'] = 'path/to/redirect';

// New way
$form_state['redirect_route'] = [
  'route_name' => 'route.name',
  'route_parameters' => ['param' => 'value'],
];

Upgrade Recommendations

This is an alpha release (8.0-alpha5) and is not recommended for production sites. It's intended for developers and site builders who want to test and contribute to Drupal 8's development.

If you're currently running Drupal 8.0-alpha4, upgrading to alpha5 is recommended for development and testing environments to stay current with the latest changes and to help identify any issues before the beta release.

For production sites, it's strongly recommended to continue using Drupal 7 until Drupal 8 reaches at least a release candidate stage. The architecture and APIs in Drupal 8 are still subject to change during the alpha phase.

When upgrading from alpha4 to alpha5:

  1. Back up your site and database
  2. Update your codebase to the 8.0-alpha5 release
  3. Run update.php to apply any database schema changes
  4. Clear all caches
  5. Test thoroughly, especially custom modules that might be affected by the architectural changes

Pay special attention to code that interacts with the field system, entity rendering, language handling, and the plugin system, as these areas have seen significant changes in this release.

Bug Fixes

UI and Display Issues

  • Fixed row format ajax broken when Drupal is installed in a subdirectory
  • Fixed inability to change Custom Block view mode
  • Fixed Views dialogs not closing via escape
  • Fixed no spacing between field label and value with inline display
  • Fixed UI glitch in Add Content
  • Fixed update.php continue button not styled properly
  • Fixed view preview broken in UI if more link is displayed
  • Fixed regression: 'User Account' displayed on front page for anonymous users
  • Fixed Language Field getting 'Stuck' after Title
  • Fixed Stark layout broken as 'generic' classes removed from html.tpl.php

Form and Validation Issues

  • Fixed browser validation error with Chrome on hidden required fields
  • Fixed inability to edit a date format after creating it
  • Fixed date format name 'custom' being reserved but not checked for
  • Fixed Views BulkFormBase showing 'Apply' button twice

Other Fixes

  • Fixed undefined index: value in theme_status_report()
  • Fixed non-ascii character in function theme_user_signature()
  • Fixed AttributeTest failing when using debian's phpunit binary
  • Fixed integrity constraint violation when translating body field
  • Fixed malformed modulename.info.yml file causing fatal error
  • Fixed DerivativeDiscoveryDecorator not checking/enforcing the proposed derivative fetchers implement interface DerivativeInterface

New Features

Plugin System and Architecture Improvements

  • Moved Widget, Formatter, and FieldType plugin types to the Core\Field system
  • Converted contextual links to a plugin system similar to local tasks/actions
  • Added support for $form_state()['redirect_route()']
  • Implemented #post_render_cache callback to allow for personalization without breaking the render cache
  • Integrated CSRF link token directly into routing system
  • Added configuration translation user interface module
  • Switched from field-level language fallback to entity-level language fallback

Field and Entity Enhancements

  • Added alt, title, width and height for default images
  • Added 'flush' back into image module
  • Allowed the image style 'itok' token to be suppressed in image derivative URLs
  • Renamed EntityRenderController to EntityViewBuilder
  • Added EntityManagerInterface and stopped typehinting with EntityManager
  • Removed menu_* entity keys and replaced them with entity links
  • Expanded ItemInterface (aggregator.module) with methods

Configuration Management

  • Added ability to import and export single config files
  • Created configuration schema for RDF module
  • Improved design of Configuration Management UI with empty table pattern

User Interface Improvements

  • Improved design of language detection and selection settings page
  • Improved CKEditor toolbar configuration accessibility
  • Disabled filter guidelines for text formats with text editors enabled
  • Used sensible block categories rather than module-name categories
  • Used block instance title on the block admin listing

Security Updates

Security Enhancements

  • Integrated CSRF link token directly into routing system, providing better protection against cross-site request forgery attacks
  • Added support for $form_state()['redirect_route()'], which helps prevent open redirect vulnerabilities by using route names instead of paths
  • Replaced path-based entity links with route names, improving security by avoiding direct path manipulation
  • Converted local_actions() to the new local action plugins, providing better structure and security

Performance Improvements

Caching Improvements

  • Added cache tags to the page cache, allowing for more granular cache invalidation
  • Implemented #post_render_cache callback to allow for personalization without breaking the render cache

JavaScript Optimization

  • Prevented drupalSettings.user.uid from being added to page when there is no other JS
  • Prevented drupal.node-new-comments-link library from being added for anonymous users
  • Added test to guarantee that the Standard profile does not load any JavaScript for anonymous users on critical pages
  • Debounced CKEditor onChange handler for better performance

Test Performance

  • Sped up RenderTest by moving integration tests into separate test
  • Made the Simpletest XDebug integration work for CLI requests

Code Efficiency

  • Used GlobIterator instead of glob for better performance
  • Removed early render in Comment Module
  • Removed unused _block_themes_access() function
  • Removed unnecessary ternaries around config()->get()

Impact Summary

Drupal 8.0-alpha5 represents a significant step forward in the development of Drupal 8, with substantial architectural improvements and code reorganization. This release focuses on enhancing the plugin system, improving field management, modernizing the codebase, and strengthening accessibility.

The most impactful changes include moving Widget, Formatter, and FieldType plugin types to the Core\Field system, implementing entity-level language fallback (replacing field-level fallback), and integrating CSRF protection directly into the routing system. These changes improve code organization, performance, and security but require developers to update their custom code accordingly.

For site builders, the addition of the configuration translation UI module and the ability to import/export single configuration files provide powerful new tools. Content editors will benefit from improved CKEditor accessibility and performance, while accessibility users will notice several enhancements throughout the system.

This alpha release continues to refine Drupal 8's architecture by removing deprecated code (like drupal_container(), drupal_set_title(), and check_plain()), standardizing naming conventions, and improving developer experience. The introduction of #post_render_cache callback allows for personalization without breaking the render cache, which is a significant performance enhancement.

While this release brings many improvements, it's important to note that as an alpha version, APIs and architecture may still change before the final release. Developers should test their custom modules thoroughly against this release to identify any compatibility issues early.

Statistics:

File Changed300
Line Additions9,276
Line Deletions4,826
Line Changes14,102
Total Commits189

User Affected:

  • Need to update code that uses Widget, Formatter, and FieldType plugins to reference the new Core\Field system
  • Should replace drupal_container() with Drupal::service() in custom modules
  • Must update any code using field-level language fallback to use entity-level language fallback
  • Need to adapt to the new plugin system for contextual links
  • Should update any custom controllers to use route-based redirects instead of path-based redirects
  • Need to update code that uses check_plain() to use \Drupal\Component\Utility\String::checkPlain() directly

Contributors:

alexpottdbuytaertjhodgdon-drpwebchick