Install

Works with Drupal: ^10 || ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 31.44 KB
MD5: 9b61ad70b97331e17a2d029ba09a206d
SHA-1: d0f6fed2abeb7ff3cd8b38130ffc118856af3c6c
SHA-256: ad819e4ca786827de6ba07b832b7efce55cb95fbfb9e2e9b7085e831fc638058
Download zip 52.09 KB
MD5: a821c49c7e38c80b5887a8fe64ef144e
SHA-1: 8ccbffa5e80936accdea1e10d90506437dec3c76
SHA-256: 636625901f21344912ce86c36e7bd995880beb1078ca8f70dbce654b3e604c8e

Release notes

# Entity Attributes Field 1.0.1

This release modernizes the EAF module for Drupal 11 compatibility with comprehensive refactoring to follow current best practices.

## What's New

### Drupal 11 Compatibility
- **Hook API Migration**: Converted all procedural hooks to the new Hook API using PHP 8 `#[Hook()]` attributes
- **Dependency Injection**: Refactored `FieldAttributeService` to use proper constructor injection instead of `\Drupal::service()` calls
- **PHP 8 Attributes**: Modernized all PHPUnit tests from doc-comment annotations to native PHP 8 attributes

### Code Quality Improvements
- **Coding Standards**: Achieved 100% compliance with Drupal and DrupalPractice coding standards (0 errors, 0 warnings)
- **Type Safety**: Added nullable type hints throughout the codebase (`?string`, `?TypedDataInterface`)
- **Array Formatting**: Fixed indentation and formatting across all array structures
- **Documentation**: Enhanced doc comments with proper formatting, spacing, and @deprecated annotations

### Testing
- **PHPUnit 11 Support**: Migrated test suite to use PHPUnit 11 attributes (`#[CoversClass]`, `#[Group]`, `#[DataProvider]`)
- **Test Stability**: Fixed all unit tests to work with the new dependency injection pattern
- **Test Coverage**: Maintained 100% passing rate for all existing unit tests

### Bug Fixes
- Fixed constructor initialization in test files
- Corrected service definitions in `eaf.services.yml` with proper dependency arguments
- Resolved deprecated PHPUnit method usage
- Fixed container initialization issues in unit tests

## Technical Details

### Breaking Changes
**None** - This release maintains backward compatibility while modernizing the internal architecture.

### For Developers
- `FieldAttributeService` now requires two constructor arguments: `EntityAttributePluginManagerInterface` and `EntityFieldManagerInterface`
- All hooks have been moved to `src/Hook/EafHooks.php` using the modern Hook API
- PHPUnit tests now use PHP 8 attributes instead of doc-comment annotations

### File Changes
- **Modified**: `src/FieldAttributeService.php` - Added dependency injection
- **Modified**: `eaf.services.yml` - Added service arguments
- **New**: `src/Hook/EafHooks.php` - Centralized hook implementations
- **Modified**: `eaf.module` - Removed procedural hooks
- **Modified**: All test files in `tests/src/Unit/` - Migrated to PHP 8 attributes

## Requirements
- **Drupal**: ^10.3 || ^11
- **PHP**: ^8.1
- **PHPUnit**: ^11.5 (for testing)

## Upgrade Path
No special upgrade steps required. Simply update the module and clear caches.

```bash
composer update drupal/eaf
drush cr

Credits

This release represents a significant modernization effort to ensure long-term maintainability and compatibility with current Drupal standards.

---
Full changelog: https://git.drupalcode.org/project/eaf/-/compare/1.0.0...1.0.1

---

Created by: denes.szabo
Created on: 17 Oct 2025 at 13:33 UTC
Last updated: 17 Oct 2025 at 13:33 UTC

Other releases