Error thrown if trying to create entity with Experience Builder field through UI

Created on 30 May 2024, 4 months ago
Updated 18 June 2024, 3 months ago

Problem/Motivation

If you try to create a node with experience builder field on it you get this error

TypeError: Cannot assign null to property Drupal\experience_builder\Plugin\DataType\ComponentTreeStructure::$value of type string in Drupal\experience_builder\Plugin\DataType\ComponentTreeStructure->setValue() (line 50 of modules/experience_builder/src/Plugin/DataType/ComponentTreeStructure.php).
Drupal\Core\TypedData\TypedData->applyDefaultValue() (Line: 243)
Drupal\Core\TypedData\Plugin\DataType\Map->applyDefaultValue() (Line: 178)
Drupal\Core\Field\FieldItemList->applyDefaultValue() (Line: 271)
Drupal\Core\Entity\ContentEntityStorageBase->initFieldValues(Object, Array) (Line: 129)
Drupal\Core\Entity\ContentEntityStorageBase->doCreate(Array) (Line: 94)
Drupal\Core\Entity\ContentEntityStorageBase->create(Array) (Line: 380)
Drupal\Core\Entity\EntityForm->getEntityFromRouteMatch(Object, 'node') (Line: 73)
Drupal\Core\Entity\HtmlEntityFormController->getFormObject(Object, 'node.default.default') (Line: 58)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 178)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
require('/Users/ted.bowman/sites/exp-d-core/index.php') (Line: 110)

Steps to reproduce

This happens for field with or without the default value set. For 1 content type I checked "Set default value" but did not check any of the values underneath this. For another content type I did not check this.

The error is not thrown for articles with the field_xb_demo on them. If I try to use the same values as field_xb_demo through the UI I am only able to set the tree value, the props is disabled and I still get the error

The same error happens when you try to edit the field

Proposed resolution

ensure it is possible to create a field through the UI.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Component

Page builder

Created by

πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

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