Problem/Motivation
The error seems to occur with content types that have Address and OfficeHours fields.
ENV:Drupal 10.3.6, php 8.3.12, Address 2.0.2, Office Hours 8.x-1.19
Thank you.
Steps to reproduce
Access admin/config/content/diff/fields:
Fatal error: Declaration of Drupal\office_hours\Plugin\diff\Field\OfficeHoursFieldDiffBuilder::build(Drupal\Core\Field\FieldItemListInterface $items) must be compatible with Drupal\diff\FieldDiffBuilderInterface::build(Drupal\Core\Field\FieldItemListInterface $field_items): mixed in /app/web/modules/contrib/office_hours/src/Plugin/diff/Field/OfficeHoursFieldDiffBuilder.php on line 25
Diff display of specific content with layout “Split fields” and “Unified Fields”, "Visual inline" is fine.
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 /app/web/modules/contrib/address/src/Plugin/diff/Field/AddressFieldBuilder.php on line 24
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3480456.patch | 609 bytes | connbi |
Issue fork diff-3480456
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
connbi commentedI'm not sure if I should modify the FieldDiffBuilderInterface like this.
I deleted the mixed return.
Comment #4
pearls commentedThanks for patch but it didn't work for me because I also have two similar errors from two separate modules.
I'm not sure if a separate integration is needed for each relevant module.
Dynamic Entity Reference Module
Smart Date Module
There's a solution for smart date here. Fix diff 2.x integration
But if there is a possibility of getting this similar error in different modules, it would be better to approach the situation on a diff basis.
Comment #5
acbramley commentedWhen 2.x was published I created issues for every module with the fixes. All modules seem to have committed these.
Please open issues in the relevant module if they still need fixing.