Fixed
Project:
Tome
Version:
8.x-1.14
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Jul 2026 at 22:53 UTC
Updated:
11 Jul 2026 at 05:48 UTC
Jump to comment: Most recent, Most recent file
I update my site and get the error:
Fatal error: Declaration of Drupal\tome_sync\Normalizer\EntityReferenceItemNormalizer::normalize($field_item, $format = null, array $context = []): ArrayObject|array|string|int|float|bool|null must be compatible with Drupal\serialization\Normalizer\EntityReferenceFieldItemNormalizer::normalize($field_item, $format = null, array $context = []): array in /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Normalizer/EntityReferenceItemNormalizer.php on line 17
Many of the administration screens only show that error.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | tome-1.15-urinormalizer-return-type.patch | 1.47 KB | mr.white |
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 #2
koffer commentedI install local a new drupal with 11.4.0 and install Tome modules and at first the site work or at least I can navigate like a normal new drupal site, but when I try to create a new node I get the same error:
Fatal error: Declaration of Drupal\tome_sync\Normalizer\EntityReferenceItemNormalizer::normalize($field_item, $format = null, array $context = []): ArrayObject|array|string|int|float|bool|null must be compatible with Drupal\serialization\Normalizer\EntityReferenceFieldItemNormalizer::normalize($field_item, $format = null, array $context = []): array in /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Normalizer/EntityReferenceItemNormalizer.php on line 17Comment #3
larowlanYep, breaking change in core unfortunately - we need to change the return typehint to :array
Comment #4
larowlanComment #5
koffer commentedI was able to fix the site doing some change in code.
I change the files in /tome_sync/src/Normalizer/
so I switch from:
public function normalize($field_item, $format = null, array $context = []): ArrayObject|array|string|int|float|bool|nullto something like:
public function normalize($field_item, $format = null, array $context = []): arrayand basically change all files there to use
[]): arrayIt's a rather naive change, but at least the site started working and I was actually able to start exporting with Tome and updating the website online.
If I check with drush ws I still get the errors:
PHP Deprecated: Drupal\tome_sync\Normalizer\PathAliasNormalizer::__construct(): Implicitly marking parameter $entity_type_repository as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/web/modules/contrib/tome/modules/tome_sync/src/Normalizer/PathAliasNormalizer.php on line 42But At least I get site online again. I hope Tome modules get a better solution Soon.
Comment #6
koffer commentedComment #7
larowlanThanks koffer - are you interested in creating a merge-request with your fixes?
The PHP Deprecated issue is #3586893: Patch for PHP 8.4 (explicit nullable type)
I could do a new release with both fixes
Comment #8
koffer commentedHi. I prefer that you continue with the solution in the other issue. My solution involved asking the AI, and I don't have much knowledge about how the Tome module works. I think it would complicate things if I added my code.
Comment #9
larowlanOk, thanks - I will try to resolve it this week
Comment #10
joseph.olstad#3586893: Patch for PHP 8.4 (explicit nullable type)
Comment #12
joseph.olstadcombined the php 8.4 deprecation fix along with the typehint compatibility fix.
Comment #13
joseph.olstadpatch
Comment #14
larowlanAlso looks like you've bundled some D12/dr compatibility?
I'm happy to do both in one, but it will take a bit longer, so I'm thinking fix the fatal on 11.4 and the 8.4 issue and come back for D12
Comment #17
larowlanhttps://www.drupal.org/project/tome/releases/8.x-1.15
I'll do the other stuff in D12 fixes - the module only has low installs (1200) but I'm nearly up to modules that low in usage so it should come around in the next fortnight
Comment #21
mr.white commentedThere are related errors that appear upon user login with Drupal 11.4.1 and Tome 1.15. This patch appears to fix them.
Comment #22
joseph.olstad@mr.white that patch looks like a revert of the fix?
Comment #23
joseph.olstadComment #24
mr.white commentedI believe the fix was applied too broadly and this rolls back a specific instance.
Comment #26
larowlanthanks @mr.white - you're correct that function does indeed return things that aren't an array - https://www.drupal.org/project/tome/releases/8.x-1.16 includes the change
Comment #27
joseph.olstadk00l thx
Comment #28
mr.white commented8.16 is working well for me.
Great work, everyone! 👏
Comment #29
larowlanLooking for testers on #3609621: Resolve test failure and errors. which preps the module for D12