- Issue created by @jessebaker
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Works fine here on HEAD (
5865071b7bf4ebcdddd6fd9f77dd6a5b045f22be
): I added the SDC to a region and placed the Druplicon SDC in there:
Can you please post precise steps to reproduce?
(Alternatively, at least the last ~5 lines of the logged PHP stack trace, so I can narrow it down from the other direction.)
- π¬π§United Kingdom jessebaker
Steps to reproduce are as simple as:
Create new node
Enter XB
Drag+drop the One column component into the Content regionI've done a full reinstall,
drush cr
etc. Using Olivero with the XB Global Regions enabled in the theme settings.Full stack trace from logs is as follows:
TypeError: Cannot assign null to property Drupal\experience_builder\Plugin\DataType\ComponentTreeStructure::$tree of type array in Drupal\experience_builder\Plugin\DataType\ComponentTreeStructure->setValue() (line 124 of /Users/jesse.baker/Sites/drupal11xb/web/modules/contrib/experience_builder/src/Plugin/DataType/ComponentTreeStructure.php). Backtrace #0 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/TypedData/TypedDataManager.php(216): Drupal\experience_builder\Plugin\DataType\ComponentTreeStructure->setValue('null', false) #1 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php(123): Drupal\Core\TypedData\TypedDataManager->getPropertyInstance(Object(Drupal\experience_builder\Controller\HardcodedPropsComponentTreeItem), 'tree', 'null') #2 /Users/jesse.baker/Sites/drupal11xb/web/modules/contrib/experience_builder/src/Plugin/Field/FieldType/ComponentTreeItem.php(199): Drupal\Core\TypedData\Plugin\DataType\Map->get('tree') #3 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php(135): Drupal\experience_builder\Plugin\Field\FieldType\ComponentTreeItem->onChange('tree', false) #4 /Users/jesse.baker/Sites/drupal11xb/web/modules/contrib/experience_builder/src/Plugin/Field/FieldType/ComponentTreeItem.php(222): Drupal\Core\TypedData\Plugin\DataType\Map->set('tree', 'null', false) #5 /Users/jesse.baker/Sites/drupal11xb/web/modules/contrib/experience_builder/src/Controller/ApiPreviewController.php(141): Drupal\experience_builder\Plugin\Field\FieldType\ComponentTreeItem->setValue(Array) #6 /Users/jesse.baker/Sites/drupal11xb/web/modules/contrib/experience_builder/src/Controller/ApiPreviewController.php(66): Drupal\experience_builder\Controller\ApiPreviewController->clientLayoutAndModelToXbField(Array, Array) #7 [internal function]: Drupal\experience_builder\Controller\ApiPreviewController->__invoke(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\node\Entity\Node)) #8 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Object(Drupal\experience_builder\Controller\ApiPreviewController), Array) #9 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/Render/Renderer.php(593): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #10 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #11 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Object(Drupal\experience_builder\Controller\ApiPreviewController), Array) #12 /Users/jesse.baker/Sites/drupal11xb/vendor/symfony/http-kernel/HttpKernel.php(183): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #13 /Users/jesse.baker/Sites/drupal11xb/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #14 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /Users/jesse.baker/Sites/drupal11xb/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /Users/jesse.baker/Sites/drupal11xb/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /Users/jesse.baker/Sites/drupal11xb/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /Users/jesse.baker/Sites/drupal11xb/web/core/lib/Drupal/Core/DrupalKernel.php(709): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /Users/jesse.baker/Sites/drupal11xb/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #26 {main}
- First commit to issue fork.
- π¬π§United Kingdom longwave UK
My bad, this is an oversight in π Throw exceptions instead of returning tuples for validation errors Active .
Previously we would return the structured tree and try to store it, even if it was invalid, because we need to be able to preview it still. A mistake in that issue means we return NULL on an invalid tree instead.
We can work around this by making the validation optional in the preview case, until π Improve server-side error handling Active lands which there is already a @todo for.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Looks good to me, nice one!
- πΊπΈUnited States tedbow Ithaca, NY, USA
Does this point to the fact that we don't have e2e test coverage for adding components that have slots?
I guess we had it in
ui/tests/e2e/components-slots.cy.js
but decided to skip the test in π Allow dragging components to top/bottom of page and in between adjacent components with slots Fixed . We going to added it back in π Write end-to-end test for dragging components into slots Postponed . I changed the issue to "major" because I think with any commit we could break "slots" functionality and won't know it -
tedbow β
committed e83efd54 on 0.x authored by
longwave β
Issue #3498213 by longwave, jessebaker, wim leers: Unable to add SDCs...
-
tedbow β
committed e83efd54 on 0.x authored by
longwave β
- πΊπΈUnited States tedbow Ithaca, NY, USA
Tested it manually and it does fix the problem but we should try to get π Write end-to-end test for dragging components into slots Postponed fixed
Automatically closed - issue fixed for 2 weeks with no activity.