AddressFieldBuilder::build no longer compatible with diff's CoreFieldBuilder::build

Created on 10 July 2024, 5 months ago

Diff module has added type hinting to a bunch of their methods which is breaking a few modules that are extending those methods.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada porchlight

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @porchlight
  • πŸ‡·πŸ‡ΈSerbia bojanz

    This is for compatibility with Diff 2.0.x, right? Diff 8.x-1.x still works?

  • πŸ‡¨πŸ‡¦Canada porchlight

    Yes! Sorry, I guess I should have stated that.

  • πŸ‡ΊπŸ‡¦Ukraine evgen

    It fixes this problem as well!
    Fatal error: Declaration of Drupal\address\Plugin\diff\Field\AddressFieldBuilder::build(Drupal\Core\Field\FieldItemListInterface $field_items) must be compatible with Drupal\diff\Plugin\diff\Field\CoreFieldBuilder::build(Drupal\Core\Field\FieldItemListInterface $field_items): array in /project/docroot/modules/contrib/address/src/Plugin/diff/Field/AddressFieldBuilder.php on line 24

    Thanks!

  • πŸ‡¦πŸ‡ΉAustria maxilein

    Thanks!
    I can confirm it solved my problem:

    PHP Fatal error: Declaration of Drupal\\address\\Plugin\\diff\\Field\\AddressFieldBuilder::build(Drupal\\Core\\Field\\FieldItemListInterface $field_items) must be compatible with Drupal\\diff\\Plugin\\diff\\Field\\CoreFieldBuilder::build(Drupal\\Core\\Field\\FieldItemListInterface $f<h2></h2>ield_items): array in /.../.../modules/contrib/address/src/Plugin/diff/Field/AddressFieldBuilder.php on line 24

    D 10.3.6 php 8.3

Production build 0.71.5 2024