Home

>

Tools

>

Drupal

>

Releases

>

8.0-alpha8

Drupal Release: 8.0-alpha8

Pre Release

Tag Name: 8.0-alpha8

Release Date: 1/22/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-alpha8 brings significant architectural improvements and modernization to the Drupal platform. This release focuses on cleaning up technical debt, improving developer experience, and enhancing performance. Key changes include objectification of the language system, field API improvements, migration of procedural code to object-oriented controllers, and numerous bug fixes. The release also introduces configuration schema validation, improved caching mechanisms, and updated JavaScript libraries. These changes represent important steps toward a more modern, maintainable, and performant Drupal 8.

Highlight of the Release

    • Objectification of the language system for better multilingual support
    • Configuration schema validation to ensure data consistency and correctness
    • Conversion of procedural code to object-oriented controllers for better maintainability
    • Field API improvements with conversion to plugins and TypedData integration
    • Updated JavaScript libraries (Backbone and Underscore)
    • Improved caching mechanisms for better performance
    • Conversion of theme functions to Twig templates
    • Enhanced Views functionality and UI improvements
    • Removal of first/last/odd/even classes in favor of CSS3 pseudo selectors
    • Double-click prevention on form submission

Migration Guide

Migrating to Drupal 8.0-alpha8

API Changes

  1. Language System

    • The language system has been completely objectified
    • Replace language_list() with the language manager service
    • $user->language and $user->theme have been removed
    • Use the language manager for language negotiation instead of direct function calls
  2. Field API

    • field_is_translatable() has been removed
    • Field Language API has been removed
    • Deprecated procedural functions in Field API have been removed
    • Use the new TypedData plugins instead of legacy field implementations
    • Field types now must provide a schema() method
  3. Entity API

    • EntityType is now a domain object with expanded capabilities
    • Custom EntityType controllers can now be provided by modules
    • Entity form functions have been cleaned up and modernized
  4. Theme System

    • First/last/odd/even classes have been removed in favor of CSS3 pseudo selectors
    • Theme functions are being converted to Twig templates
    • Use the new hook_theme_suggestions_alter() for theme suggestions
  5. JavaScript Changes

    • Backbone and Underscore have been updated
    • drupal_add_js() and drupal_add_css() are now discouraged with leading underscores
    • drupal_add_library() is being removed

Code Migration Examples

Old language code:

$languages = language_list('enabled');
$user_language = $user->language;

New language code:

$languages = \Drupal::languageManager()->getLanguages();
$user_language = \Drupal::languageManager()->getCurrentLanguage();

Old field code:

if (field_is_translatable('node', 'body')) {
  // Do something
}

New field code:

$field_definition = \Drupal::entityManager()
  ->getFieldDefinitions('node', 'article')['body'];
if ($field_definition->isTranslatable()) {
  // Do something
}

Old theme code:

$variables['classes_array'][] = ($delta == 0) ? 'first' : '';
$variables['classes_array'][] = ($delta == $count - 1) ? 'last' : '';
$variables['classes_array'][] = ($delta % 2) ? 'odd' : 'even';

New theme code:

// No longer needed - use CSS :first-child, :last-child, :nth-child(odd/even)

Configuration Updates

  1. If you have custom configuration schemas, ensure they follow the new validation requirements
  2. Update any custom entity types to implement the new EntityType domain object requirements
  3. Review and update any custom field types to provide schema() methods

Upgrade Recommendations

For Development Sites

Recommendation: Proceed with caution

This alpha release contains significant architectural changes and API improvements that are important for developers to test against. If you're running a development site or contributing to Drupal 8, you should upgrade to get familiar with these changes.

Key considerations:

  • This is an alpha release and not suitable for production sites
  • Many APIs are still in flux and may change in future releases
  • Test thoroughly, especially if you have custom modules that interact with:
    • The language system
    • Field API
    • Entity system
    • Configuration system
    • Theme system

For Production Sites

Recommendation: Do not upgrade

Drupal 8.0-alpha8 is an alpha release and is not intended for production use. Production sites should remain on Drupal 7 until Drupal 8 reaches at least RC status.

For Module Developers

Recommendation: Start adapting your modules

This is an excellent time to begin updating your modules for Drupal 8 compatibility. Key areas to focus on:

  • Adapting to the objectified language system
  • Converting any field implementations to the new plugin system
  • Updating entity type definitions to work with the new EntityType domain object
  • Converting theme functions to Twig templates
  • Updating JavaScript to work with the latest Backbone and Underscore versions

Testing Recommendation

When testing this release, pay particular attention to:

  • Multilingual functionality
  • Configuration import/export
  • Field display and editing
  • Entity creation and editing
  • Views functionality
  • JavaScript interactions, especially with forms and in-place editing

Bug Fixes

Critical Bug Fixes

  • Search Excerpt Highlighting: Fixed search_excerpt() to properly highlight words matched via search_simplify().
  • PostgreSQL Issues:
    • Fixed site search indexing on PostgreSQL
    • Fixed rowCount() usage in PostgreSQL and SQLite drivers
  • Configuration System:
    • Fixed critical performance regression due to config schema + TypedData lookups in installer
    • Fixed router rebuild failures when provider of existing routes changed
  • Entity System:
    • Fixed creating config entities with existing machine names
    • Fixed missing UUID field for 'aggregator_feed' entity type
  • Field and Form Issues:
    • Fixed PHP notice on multiple items image field
    • Fixed node preview removing file values from node edit form for non-displayed items
    • Fixed weird handling of 'default_value_function' in date widgets

UI and Functionality Fixes

  • Toolbar Issues:
    • Fixed broken "Back to site" button
    • Fixed toolbar scrollbar not scrolling
  • Views Issues:
    • Fixed fatal error in "View" area handler
    • Fixed inability to hide views block title
    • Fixed views that use fields with long names (32+ characters) throwing errors
    • Fixed views REST export with empty field values
  • Admin Interface:
    • Fixed missing second level tabs for Permissions and Roles
    • Fixed missing local tasks on the 'Manage form display' page
    • Fixed broken draggable table on image style form
  • Multilingual:
    • Fixed contextual links and erroneously added tabs after enabling content translation
    • Fixed translation imports taking excessive time in tests

JavaScript and Frontend Fixes

  • Dialog System: Fixed Drupal.dialog to properly expect a DOM element, not a string or jQuery object
  • Edit Module: Fixed two memory leaks and subtle bugs in Edit's JavaScript
  • CKEditor: Fixed issues with paths to locale
  • Image Handling: Fixed caption filter not wrapping images that are only aligned, not captioned

Performance and System Fixes

  • Caching:
    • Fixed BackendChain::removeBin() which was broken
    • Fixed render cache cleanup when permissions change
  • Database:
    • Fixed select queries using rowCount() incorrectly to calculate number of rows
    • Fixed prefixes in config_get_storage_names_with_prefix
  • Installation:
    • Fixed installer starting with fatal error if settings.php already contains database configuration
    • Fixed node addition being broken when only one content type exists

New Features

Architecture and API Improvements

  • Objectified Language System: Complete overhaul of the language system, moving from procedural code to an object-oriented approach for better multilingual support.
  • Configuration Schema Validation: New system to ensure configuration data is consistent and correct when saving and validating forms.
  • Field API Improvements:
    • Conversion of field types to TypedData plugins
    • Field widgets and formatters for base fields can now be configured in Field UI
    • Removal of deprecated Field Language API
  • Entity System Enhancements:
    • UUID support for users 0 and 1
    • Better handling of non-integer entity IDs
    • Optimized content entity serialization
    • EntityType promoted to a domain object
  • Page Object System: Normalized Controller/View-listener behavior with a Page object for better consistency.
  • Access Checker Improvements: Made access checkers easier to find and use.
  • New Hook: Added hook_theme_suggestions_alter() for more flexible theming.
  • Site UUID: Created on install to ensure config sync only happens between sites with the same UUID.
  • Title Search Feature: Added to the node listing admin page.

UI and UX Improvements

  • Toolbar Enhancements:
    • Renamed "menu" tab to "manage" for clarity
    • Cleaner vertical state background
    • Fixed RTL styling issues
  • Form Improvements:
    • Double-click prevention on form submission
    • Better handling of node type settings (published state, promoted state, revisions)
  • Email Improvements: Set fixed "from" and added "Reply-to" headers to improve deliverability.
  • Search Ranking Settings: Renamed from "weights" to avoid confusion.

Views and Blocks

  • Views Conversions: Several system blocks converted to Views for better customization:
    • "Recent content" block
    • "Who's new" block
  • Views Enhancements:
    • Support for adding metadata in hook_views_data()
    • Fixed block caching settings
    • Route parameters can now be defined via the Views UI
    • Fixed preview for feeds

JavaScript and Frontend

  • Updated Libraries:
    • Backbone and Underscore updated to latest versions
    • Twig updated to 1.15.* from 1.12.*
  • In-place Editing: Fixed memory leaks and improved performance
  • Image Handling: Improved caption filter for better handling of aligned images

Security Updates

No significant security fixes were explicitly mentioned in the release notes. However, several system improvements that could indirectly enhance security were implemented:

  1. Better validation of configuration data through the new configuration schema system
  2. Improved exception handling in various components
  3. Fixed issues with password hashing in tests
  4. Better handling of file uploads and URIs before validation

These changes, while not explicitly labeled as security fixes, contribute to a more secure system by improving data validation and error handling.

Performance Improvements

Caching Improvements

  • Client-side Cache Tags: Implemented client-side cache tags and caching to eliminate HTTP requests per page for in-place editing metadata, introducing drupalSettings.user.permissionsHash.
  • Render Cache Cleanup: Improved render cache cleanup when permissions change, ensuring users see the correct content based on their permissions.
  • Views Block Caching: Fixed regression where Views block cache settings weren't working properly.

Database Optimizations

  • Query Improvements: Select queries now use more efficient methods to calculate number of rows instead of rowCount().
  • Entity Serialization: Optimized content entity serialization for better performance.

System Performance

  • Password Hashing: Reduced impact of password hashing on test performance.
  • Translation Imports: Fixed translation imports taking excessive time in tests even when not needed.
  • Configuration System: Fixed critical performance regression due to config schema + TypedData lookups in installer.
  • Update Information: Fixed timeout issues when fetching update information.

JavaScript Performance

  • In-place Editing: Fixed memory leaks in Edit's JavaScript code, improving frontend performance.
  • Node History: Improved handling of node history markers to reduce HTTP requests.
  • Form Submission: Added double-click prevention on form submission to avoid duplicate processing.

Impact Summary

Drupal 8.0-alpha8 represents a significant milestone in Drupal 8's development journey, focusing on architectural improvements, code modernization, and developer experience enhancements. This release brings substantial changes to core systems including the language system, field API, entity system, and configuration management.

The objectification of the language system marks a complete overhaul of how Drupal handles multilingual functionality, moving from procedural code to a more maintainable object-oriented approach. This change, while breaking backward compatibility, provides a more robust foundation for multilingual sites.

Field API improvements continue the transition to TypedData plugins, with all field types now required to provide schema definitions. The ability to configure base field widgets and formatters in Field UI represents a significant usability improvement for site builders.

Configuration schema validation ensures data consistency and correctness, addressing a common source of errors in previous versions. The introduction of site UUIDs for configuration synchronization adds an important safety mechanism to prevent accidental imports between unrelated sites.

The conversion of procedural code to object-oriented controllers continues throughout core, with several system pages and blocks now implemented as modern controllers or Views. This improves maintainability and provides more extension points for developers.

Frontend improvements include updated JavaScript libraries, better in-place editing, and the removal of first/last/odd/even classes in favor of CSS3 pseudo selectors. The conversion of theme functions to Twig templates continues, with several key modules now using the new templating system.

Performance enhancements focus on caching improvements, optimized entity serialization, and reduced HTTP requests. Bug fixes address issues across multiple subsystems, with particular attention to PostgreSQL compatibility, Views functionality, and the configuration system.

For developers, this release requires significant adaptation to new APIs and patterns, but provides a cleaner, more consistent foundation to build upon. For site builders and administrators, the improvements in Views, search functionality, and the admin interface offer better tools for creating and managing content.

As an alpha release, 8.0-alpha8 is not recommended for production sites but provides an important preview of Drupal 8's evolving architecture and capabilities.

Statistics:

File Changed300
Line Additions7,857
Line Deletions5,362
Line Changes13,219
Total Commits250

User Affected:

  • Improved developer experience with cleaner APIs and better documentation
  • Migration from procedural to object-oriented code requires learning new patterns
  • New configuration schema validation ensures data consistency
  • Updated JavaScript libraries (Backbone and Underscore) provide modern frontend capabilities
  • Field API improvements with conversion to plugins and TypedData integration

Contributors:

dbuytaertjhodgdon-drpalexpottwebchick