Home

>

Tools

>

Drupal

>

Releases

>

8.0-alpha12

Drupal Release: 8.0-alpha12

Pre Release

Tag Name: 8.0-alpha12

Release Date: 5/28/2014

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-alpha12 brings significant architectural improvements and developer experience enhancements. This release focuses on modernizing Drupal's codebase with better OOP practices, PSR-4 compliance, and improved plugin systems. Key highlights include a new PSR-3 logging framework, enhanced entity API with simplified loading methods, improved block system flexibility, and numerous performance optimizations. This release represents continued progress toward a more maintainable, modular, and developer-friendly Drupal 8.0.

Highlight of the Release

    • New PSR-3 compliant logging framework replacing the old watchdog system
    • Simplified entity API with new methods like Entity::load(), loadMultiple(), and create()
    • Complete migration of module code to PSR-4 for better maintainability
    • Enhanced block system with context-aware blocks and usage outside entity contexts
    • Improved configuration management with collection support
    • Updated CKEditor to version 4.4 with enhanced features
    • Better security with improved CSRF token generation using random seeds

Migration Guide

PSR-4 Module Code Migration

If you have custom modules, you should update your code structure to follow PSR-4 standards:

  1. Move your module files from lib/Drupal/your_module/ to src/
  2. Update your namespaces accordingly
  3. Make sure your class file paths match their namespaces

Entity API Changes

Several entity API methods have been added to simplify code:

// Old way
$entity = entity_load('node', $id);
$entities = entity_load_multiple('node', $ids);

// New way
$entity = \Drupal\node\Entity\Node::load($id);
$entities = \Drupal\node\Entity\Node::loadMultiple($ids);

// Creating entities
$entity = \Drupal\node\Entity\Node::create(['type' => 'article']);

Watchdog to PSR-3 Logger Migration

The old watchdog system has been replaced with a PSR-3 compliant logging framework:

// Old way
watchdog('my_module', 'Something happened: @message', ['@message' => $message], WATCHDOG_WARNING);

// New way
\Drupal::logger('my_module')->warning('Something happened: @message', ['@message' => $message]);

Form API Changes

Form validation and submission logic has been moved to dedicated classes:

  1. If you were extending or altering FormBuilder directly, review your code
  2. Form validation now uses a dedicated validator service
  3. Form submission now uses a dedicated submitter service

Block Plugin System Changes

Block plugins can now be used outside the block entity context:

  1. If you have custom block plugins, ensure they don't depend on being within a block entity
  2. Use the new context-aware block functionality for blocks that need contextual information

Configuration System Changes

Configuration now supports collections:

  1. If you're directly accessing configuration storage, be aware of the collection concept
  2. Update any custom configuration storage handlers to support collections

Upgrade Recommendations

This alpha release (8.0-alpha12) contains significant architectural changes and is not recommended for production sites. It's primarily intended for:

  1. Module developers who want to update their modules to work with Drupal 8
  2. Contributors who want to help test and improve Drupal 8
  3. Early adopters who want to experiment with Drupal 8 features

If you're currently running a previous Drupal 8 alpha, you should:

  1. Back up your database and files
  2. Update your codebase to 8.0-alpha12
  3. Run update.php to apply database updates
  4. Clear caches thoroughly

Be aware that APIs may still change significantly before the final release, so custom and contributed modules may need frequent updates.

For production sites, it's recommended to continue using Drupal 7 until Drupal 8 reaches at least a beta or RC status.

Bug Fixes

Entity and Field Issues

  • Entity Form Access: Fixed issue where EntityForm::actions() was adding 'delete' without checking access
  • Entity Reference UX: Fixed UX issues with Entity Reference fields
  • Field Widget Conversion: Converted path.module form alters to a field widget
  • Entity Display Bleeding: Fixed overridden config bleeding through to admin forms
  • Entity Reference Field: Fixed PHP notice when adding an Entity Reference field in the Field UI

UI and Display Issues

  • Views Display Tabs: Removed gray top border from Views display tabs
  • Views Display Links: Fixed issue where hovering about display links changes the position
  • Views UI Messages: Added missing confirmation messages when Views UI settings forms are saved
  • Color Module: Fixed duplicated color palette setting controls
  • Menu Links: Fixed issue where external URLs or <front> couldn't be added as menu items
  • Block Category: Fixed block category autocomplete not working
  • Pager Styling: Fixed pager link underlinings not displaying properly
  • Vertical Tabs: Fixed styling issue where vertical tabs were pushed to the right on node edit form

Multilingual and RTL Issues

  • RTL Support: Fixed regression where early installer was not in RTL after selecting RTL language
  • Translation UI: Improved source translation column display logic to only show when there are 2+ source languages

Form and Validation Issues

  • Numeric Placeholders: Fixed fatal error when using numeric placeholders in paths in Views UI
  • Page Titles: Fixed issue with page titles containing %placeholders when used as breadcrumbs
  • Password Managers: Fixed issue where password managers were identifying/storing wrong username field when creating a user account

Other Fixes

  • Stream Wrappers: Fixed issue where stream wrappers of test runner were not restored after test completion
  • Node Condition: Fixed NodeType condition not evaluating properly
  • Image Processing: Fixed "Color index out of range" error in GDToolkit
  • Search Indexing: Fixed issue where search_touch_node()/search_mark_for_reindex() would update unnecessarily

New Features

Entity API Improvements

  • Simplified Entity Loading: New static methods Entity::load() and loadMultiple() make entity loading more straightforward
  • Entity Creation Helper: New ::create() method simplifies creating new entities
  • Bundle Entity Base Class: Introduced a common config entity base class for all bundle config entity types
  • Field Definition Repository: Unified repository of field definitions with improved caching and API

Architecture Enhancements

  • PSR-3 Logging Framework: Replaced the old watchdog system with a PSR-3 compliant logging framework
  • PSR-4 Module Code: Moved all module code to PSR-4 for better maintainability
  • Key Value Entity Storage: Added new storage system for simple key-value entity data
  • Config Collections: Added concept of collections to config storages for better organization
  • Class Resolver: New generic class resolver for better dependency injection

Block System Improvements

  • Context-Aware Blocks: Blocks can now be context-aware for more dynamic content
  • Flexible Block Plugins: Block plugins can now be used outside the block entity context
  • Improved Block Management: Better handling of block configuration and display

Form System Enhancements

  • Form Validation Class: Moved form validation logic out of FormBuilder into a dedicated class
  • Form Submission Class: Moved form submission logic out of FormBuilder into a dedicated class
  • Request Stack Integration: Form builder now uses request stack for better integration

Caching Improvements

  • Local PHP Storage Cache: Added a local, PhpStorage-based cache backend
  • APCu Support: Built-in APCu support in core (PHP 5.5 only)
  • Millisecond Cache Creation: Cache creation timestamps now use millisecond precision

Security Updates

CSRF Protection Enhancement

  • Random Seed for CSRF Tokens: Implemented the use of a random seed instead of the session_id for CSRF token generation, providing stronger protection against cross-site request forgery attacks

Access Control Improvements

  • Entity Form Access: Fixed issue where EntityForm::actions() was adding 'delete' button without properly checking access permissions
  • Role Recommendation: Added trusted roles recommendation to 'access site reports' permission to improve security guidance

Session Security

  • Session Management: Rebased SessionManager onto Symfony NativeSessionStorage for improved security and standards compliance
  • Session HTTPS Testing: Fixed SessionHttpsTest which was only running half the tests, ensuring better HTTPS session security testing

Performance Improvements

Caching Enhancements

  • Production Defaults: Changed all default settings and config to fast/safe production values for better out-of-box performance
  • Cache Backend: Added a local, PhpStorage-based cache backend for improved performance
  • APCu Support: Built-in APCu support in core (PHP 5.5 only) for better caching performance
  • Millisecond Precision: Cache creation timestamps now use millisecond precision for more accurate cache invalidation

Test Performance Improvements

  • Test Kernel Optimization: Fixed issue where run-tests.sh was building and rebuilding two kernels from scratch for every PHP process
  • CSS/JS Handling: Disabled CSS/JS aggregation and caching in tests by default for faster test execution
  • Search Test Performance: Fixed test performance of various search module tests
  • Taxonomy Test Performance: Fixed test performance of Taxonomy LegacyTest

Entity System Optimizations

  • Entity Render Caching: Improved entity render caching using #pre_render pattern
  • Field Definition Caching: Unified repository of field definitions with better caching
  • Entity View Builder: Reordered methods in EntityViewBuilder into more logical sequence for better performance

URL and Routing Improvements

  • URL Generator: Sped up UrlGenerator by setting the 'external' option in the Url object
  • Route Handling: Improved route handling and processing for better performance

Other Performance Enhancements

  • Database Optimizations: Minor bug fixes and optimizations in the database system
  • Memory Usage: Improved memory usage tracking and management
  • Page Cache: Removed 'Forever' from the Page cache maximum age options for better cache control

Impact Summary

Drupal 8.0-alpha12 represents a significant step forward in the modernization of Drupal's architecture. The move to PSR-4 for all module code improves maintainability and aligns with PHP best practices. The new PSR-3 logging framework replaces the old watchdog system with a more standardized approach. Entity developers will appreciate the simplified API with new methods like Entity::load(), loadMultiple(), and create().

The block system has been enhanced to allow blocks to be context-aware and usable outside entity contexts, providing more flexibility for developers. Configuration management now supports collections, enabling better organization of configuration data. Performance improvements include built-in APCu support, a new PhpStorage-based cache backend, and optimized entity rendering.

Security has been strengthened with improved CSRF token generation using random seeds instead of session IDs. The form system has been refactored to separate validation and submission logic into dedicated classes, making it more maintainable and extensible.

For site builders, there are UX improvements in Entity Reference fields, better block management, and more consistent form validation. Content editors will benefit from enhanced in-place editing capabilities and the updated CKEditor 4.4.

While this alpha release contains many improvements, it's still not recommended for production sites as APIs may continue to change before the final release. This release primarily targets module developers, contributors, and early adopters who want to prepare for and help shape Drupal 8.

Statistics:

File Changed300
Line Additions1,564
Line Deletions1,120
Line Changes2,684
Total Commits250

User Affected:

  • Improved entity API with new methods like `Entity::load()`, `loadMultiple()`, and `create()` for simpler entity handling
  • PSR-4 compliance for module code, making the codebase more maintainable and following PHP best practices
  • New PSR-3 logging framework replacing the old watchdog system
  • Enhanced block plugin system allowing blocks to be used outside entity contexts
  • New key-value entity storage system
  • Improved configuration management with collection support

Contributors:

alexpottwebchickdbuytaertjhodgdon-drp