Error "Illegal offset type" with multiple custom fields in paragraphs

Created on 28 May 2025, 10 days ago

Problem/Motivation

Hi,

I'm encountering a recurring error with multiple custom field images when they are integrated into paragraphs. In the same node, when multiple paragraphs contain a multiple custom field with images, an error occurs if an image in paragraph 1 is modified/added after paragraph 2 has been created.

Results

White screen "The website encountered an unexpected error."

TypeError: Illegal offset type in Drupal\Core\Entity\EntityStorageBase->load() (line 263 of .../core/lib/Drupal/Core/Entity/EntityStorageBase.php).

Array to string conversion in Drupal\Core\Entity\EntityStorageBase->buildCacheId() (.../core/lib/Drupal/Core/Entity/EntityStorageBase.php line 142)

array_flip(): Can only flip string and integer values, entry skipped in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (.../core/lib/Drupal/Core/Entity/EntityStorageBase.php line 278)

Steps to reproduce

  1. Create a content type with multiple paragraph fields
  2. Create a paragraph type containing a multiple custom field with an image field
  3. Create a node with 2 paragraphs
  4. Add several images in each custom field
  5. Save and modify again by adding/removing images
  6. If the number of custom fields differs between the 2 paragraphs, the node cannot be saved and returns an error

Proposed resolution

Remaining tasks

🐛 Bug report
Status

Active

Version

3.1

Component

Code

Created by

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024