Error: Call to a member function uuid() on null

Created on 21 April 2025, about 8 hours ago

Problem/Motivation

When creating a translated version of a page sometimes it errors out with the following message:

Error: Call to a member function uuid() on null in {closure}() (line 430 of modules/contrib/layout_paragraphs/layout_paragraphs.module).

array_map(Object, Array) (Line: 429)
layout_paragraphs_entity_translation_create(Object)
call_user_func_array(Object, Array) (Line: 416)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'layout_paragraphs') (Line: 395)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_translation_create', Object) (Line: 415)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_translation_create', Array) (Line: 217)
Drupal\Core\Entity\EntityStorageBase->invokeHook('translation_create', Object) (Line: 900)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('translation_create', Object) (Line: 363)
Drupal\Core\Entity\ContentEntityStorageBase->createTranslation(Object, 'en-nz', Array) (Line: 995)
Drupal\Core\Entity\ContentEntityBase->addTranslation('en-nz', Array) (Line: 108)
Drupal\content_translation\Controller\ContentTranslationController->prepareTranslation(Object, Object, Object) (Line: 414)
Drupal\content_translation\Controller\ContentTranslationController->add(Object, Object, Object, 'taxonomy_term')

Steps to reproduce

I'm assuming that these entities no longer exists and it's trying to load them up anyways.

Proposed resolution

If the paragraph loads up NULL then remove it from the list of paragraphs in the `layout_paragraphs_entity_translation_create` function.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States spfaffly

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024