Skip to content

Releases: jhedstrom/DrupalDriver

v2.5.0

17 Apr 06:34
ff64e2d

Choose a tag to compare

What's new since v2.4.3

Important

This is the last 2.x release with Drupal 7 support. Only critical bug fixes will be worked on as patches for 2.5, if required.
We are working on 3.x, which will remove Drupal 6/7 support and potentially update some APIs.

Breaking changes

  • Added 'moduleInstall()' and 'moduleUninstall()' to all drivers. @phenaproxima, @AlexSkrypnyk (#315)
    New methods moduleInstall($module_name) and moduleUninstall($module_name) have been added to DriverInterface and CoreInterface. Consumers that implement either interface directly must add both methods to their own classes - the simplest migration is to throw UnsupportedDriverActionException, matching BaseDriver's default. Consumers that extend BaseDriver, DrupalDriver, or DrushDriver need no code changes; the parent classes already provide working implementations.

  • Rewrote 'AddressHandler' with named key support and multi-value handling. @BramDriesen, @daggerhart, @AlexSkrypnyk (#320)
    AddressHandler::expand() now returns one entry per delta for multi-value address fields (previously always a single-item array) and throws \RuntimeException when it receives an unrecognised named key (previously silently discarded). To migrate, audit any test data that passes associative address values and ensure every key is a valid address sub-field (given_name, family_name, organization, address_line1, address_line2, locality, administrative_area, postal_code, country_code), and update assertions that assumed a single delta for a multi-value address field.

Highlights

  • [#281] Fixed 'parseUserId()' to handle Drush 12+ table output format. @AlexSkrypnyk (#324)
    Drush 12+ switched user:information output from "User ID : 123" key-value pairs to a bordered table, which previously caused DrushDriver::parseUserId() to always return null and broke every user-related operation on newer Drush. The method now detects the table format and extracts the UID from the first data row while preserving backward compatibility with older Drush.

  • Added 'moduleInstall()' and 'moduleUninstall()' to all drivers. @phenaproxima, @AlexSkrypnyk (#315)
    Tests can now install and uninstall Drupal modules through the driver without dropping to Drush shell commands or raw PHP. The same API works across DrupalDriver (direct Drupal API), DrushDriver (Drush CLI), and all supported cores (Drupal 6, 7, and 8+).

  • Implemented proper file handling in 'FileHandler'. @azurams, @AlexSkrypnyk (#314)
    The Drupal 8+ FileHandler previously extended EntityReferenceHandler and tried a name-based entity lookup on raw file paths, which never produced a usable file entity. It now reads the file from disk and creates a managed file via the file.repository service, so tests can populate a file field by passing a local path.

  • Rewrote 'AddressHandler' with named key support and multi-value handling. @BramDriesen, @daggerhart, @AlexSkrypnyk (#320)
    Address fields can now be populated using descriptive named keys (given_name, address_line1, country_code, etc.) alongside positional numeric indices, and multi-value address fields correctly produce one delta per value instead of collapsing to a single item. Unknown keys fail loudly with a RuntimeException instead of being silently dropped.

  • Added 'DaterangeHandler' with timezone-aware date formatting. @shrimala, @AlexSkrypnyk (#317)
    The Drupal 8+ daterange field type is now a first-class citizen: the handler reads the site timezone from system.date, converts datetime values to UTC storage, and picks the correct storage format based on the field's datetime_type setting. Supports the relative: prefix, named value/end_value keys, and positional indices.

  • Added 'TimeHandler' for the 'time_field' contrib module. @ericgsmith, @AlexSkrypnyk (#306)
    First-class support for the time_field contrib module. Numeric values are stored as seconds past midnight; string values like "9:30 AM", "14:15:30", or "midnight" are parsed via strtotime() and converted to the storage format automatically.

  • Added 'NameHandler' for the Name module with tests. @sensespidey, @AlexSkrypnyk (#322)
    First-class support for the Name contrib module covering all six name components (title, given, middle, family, generational, credentials). Accepts the "Family, Given" shorthand string, named array keys, and positional indices, with multi-value field support.

All changes

  • Added PHPUnit tests for D8+ field handlers and exceptions. @AlexSkrypnyk (#331)
    Adds targeted PHPUnit coverage for the D8+ field handlers (Address, Daterange, Datetime, Default, EntityReference, File, Image, List*, SupportedImage, TaxonomyTermReference, TextWithSummary) plus BlackboxDriver and UnsupportedDriverActionException. Legacy D6/D7 sources are excluded from coverage measurement, and the CI coverage floor is raised from 10% to 35% to lock in the new D8+ baseline (39% lines).

  • Added PHPUnit code coverage reporting to CI with threshold enforcement. @AlexSkrypnyk (#330)
    Adds pcov-based coverage reporting on the PHP 8.4 / Drupal 11 matrix entry, uploads HTML, Cobertura, and text artifacts, posts a sticky per-PR coverage comment with a collapsible per-class breakdown, and fails the build when line coverage drops below a configurable threshold. Coverage regressions are now visible before merge.

  • Refactored codebase for readability: extracted methods, removed dead code, clarified naming. @AlexSkrypnyk (#329)
    Removes dead loops and unreachable branches across AbstractHandler, EntityReferenceHandler, and Drupal8; extracts long methods in AddressHandler::expand(), DrupalDriver::getDrupalVersion(), and DrushDriver; and reshapes DaterangeHandler to extend DatetimeHandler so date-format logic lives in one place. No behaviour changes.

  • Added project-level rector configuration and applied fixes. @AlexSkrypnyk (#328)
    Replaces the fragile cp+cd workaround that copied palantirnet/drupal-rector's config into the drupal/ directory with a project-level rector.php targeting PHP 7.4. composer lint and composer lint-fix now invoke Rector directly, and the dead-code, code-quality, early-return, and instanceof rule sets have been applied across 18 source and test files.

  • Updated PHPCS configuration and fixed coding standards across the codebase. @AlexSkrypnyk (#327)
    Replaces phpcs-ruleset.xml with phpcs.xml that applies both the Drupal and DrevOps standards via a new drevops/phpcs-standard dev dependency. The DrevOps standard enforces snake_case locals and parameters and dataProvider* naming for test data providers; 358 general plus 311 snake_case fixes were applied, and CI now runs lint and test as separate steps. Strict-type declarations remain deferred to v3.x.

  • Added .gitattributes for lean distribution archives. @AlexSkrypnyk (#326)
    Adds a project .gitattributes with export-ignore rules so composer install and git archive payloads contain only composer.json, LICENSE, README.md, CHANGELOG.md, and src/, dropping CI config, tests, Docker, specs, and docs tooling. Drupal scaffold is told not to overwrite the file.

  • Updated README and CONTRIBUTING to match DrupalExtension structure. @AlexSkrypnyk (#325)
    Modernises the README.md (centred heading, grouped badges, driver comparison table, single composer require install step, cleaner usage example) and expands CONTRIBUTING.md with a "How this project works" section, a field-handler reference table, a test-command table, and a v3.x roadmap pointer. Documentation-only change.

  • [#281] Fixed 'parseUserId()' to handle Drush 12+ table output format. @AlexSkrypnyk (#324)
    Drush 12+ switched user:information output from "User ID : 123" key-value pairs to a bordered table, which previously caused DrushDriver::parseUserId() to always return null and broke every user-related operation on newer Drush. The method now tries the legacy regex first and, on miss, walks the table rows to extract the UID from the first data row, preserving compatibility with older Drush.

  • Resolved project-level Drush binary in DrushDriver. @mxr576, @AlexSkrypnyk (#323)
    When the default drush binary is configured, DrushDriver now tries COMPOSER_BIN_DIR, then vendor/bin/drush relative to the current working directory, before falling back to the global drush. This avoids mismatches between the globally installed Drush and the Drush pinned by a project's composer.json. Resolution is extracted into a protected resolveProjectDrush() method that subclasses can override.

  • Added 'NameHandler' for the Name module with tests. @sensespidey, @AlexSkrypnyk (#322)
    New handler for the Name contrib module covering all six name components (title, given, middle, family, generational, credentials). Accepts the "Family, Given" shorthand string, named array keys, and positional numeric indices, with multi-value field support.

  • Added 'OgStandardReferenceHandler' for Organic Groups. @cheppers, @AlexSkrypnyk (#321)
    New handler for the Organic Groups og_standard_reference field type. The entity-lookup logic is identical to a plain entity reference, so the handler is a thin subclass of EntityReferenceHandler.

  • Rewrote 'AddressHandler' with named key support and multi-value handling. @BramDriesen, @daggerhart, @AlexSkrypnyk (#320)
    Address fields can now be populated using descriptive named keys (given_name, address_line1, country_code, etc.) alongside positional numeric arrays, and multi-value fields correctly produce one entry per delta...

Read more

v2.4.3

17 Mar 07:53

Choose a tag to compare

What's new since v2.4.2

  • Fixed 'isBaseField()' to include computed base fields. (#9) @AlexSkrypnyk

Full Changelog: v2.4.2...v2.4.3

@AlexSkrypnyk

v2.4.2

16 Mar 00:09

Choose a tag to compare

What's new since v2.4.1

  • Refreshed REQUEST_TIME before cron run to prevent stale timestamps. @AlexSkrypnyk (#302)

Full Changelog: v2.4.1...v2.4.2

@AlexSkrypnyk

v2.4.1

15 Mar 11:47

Choose a tag to compare

What's new since v2.4.0

  • Fixed isLegacyDrush() misdetecting Drush 12+ as legacy on PHP 8.4. @AlexSkrypnyk (#301)

Full Changelog: v2.4.0...v2.4.1

@AlexSkrypnyk

v2.4.0

02 Mar 23:58

Choose a tag to compare

What's new since v2.3.0

Full Changelog: v2.3.0...v2.4.0

@AlexSkrypnyk, @guillaume-a, @jhedstrom and @klausi

v2.3.0

21 Oct 16:18
52835be

Choose a tag to compare

Added

  • #241 - Allow Entity Reference Field Handler to Reference by ID
  • #261 - Broaden compatibility with symfony/process
  • #265 - PHP 8.2 testing
  • #275 - Initial Drupal 11 support
  • #276 - Drupal 11 support

2.2.2

06 Jan 17:23
632712d

Choose a tag to compare

Prep for v2.2.2.

Signed-off-by: Jonathan Hedstrom <jhedstrom@gmail.com>

2.2.1

23 Nov 19:11
f5c8197

Choose a tag to compare

Adds Drupal 10 support.

2.2.0

16 May 18:50
000ce86

Choose a tag to compare

Fixed

  • #232 Fixes typo in ImageHandler.
  • #233 Fixes Drupal 7.79 compatibility.
  • #244 Drupal Coder updates.

Added

  • #245 PHP 8.1 compatibility.
  • #247 Drupal 10 and PHP 8.1 compatibility.

2.1.1

07 May 20:49
a33cb76

Choose a tag to compare

Fixed

  • #233 Prevent PHP warning in Drupal 7.79 and above.
  • #232 Fix type in ImageHandler.