I am on Version: 3.6.0 with this patch https://www.drupal.org/project/ds/issues/3137198 but this problem was on Version 3.5.0 as well.
1. Created a fresh Content Type
2. Set the Content Type to use Layout Builder
3. Created a node of that Content Type and edited the Layout
4. Added a section. Chose one of the layouts provided by Display Suite.
5. Under Custom Wrappers, added role|navigation under Layout Attributes.
6. Added a Basic Block to the section.
7. Saved the layout.
There was this error at the top of the page, and the attribute did not appear in the HTML.
Notice: Undefined index: #entity_type in ds_preprocess_ds_layout() (line 525 of modules/contrib/ds/ds.module).
ds_preprocess_ds_layout(Array, 'ds_2col', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('ds_2col', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->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: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
(There was a second one because it was a two-column layout.)
Notice: Undefined index: # in ds_preprocess_ds_layout() (line 525 of modules/contrib/ds/ds.module).
ds_preprocess_ds_layout(Array, 'ds_2col', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('ds_2col', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->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: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
We're going to need to be adding attributes on these sections, so hopefully this can be fixed. It's a great feature.
Comment | File | Size | Author |
---|---|---|---|
#5 | 3139230-5.patch | 656 bytes | swentel |
#2 | ds-3139230.png | 42.19 KB | swentel |
Comments
Comment #2
swentel CreditAttribution: swentel at eps & kaas commentedHmm, I just tried this with the latest version #3137198: Token prevents layout builder to add new ds layout committed and this works great, see screenshot.
Tested this with default layout and override on a node.
So not sure exactly why you get the errors.
Comment #3
swentel CreditAttribution: swentel at eps & kaas commentedTested this again with latest release (with one commit as well adding even better support for ds and layout builder, but that one should not affect this). Still can't reproduce and works fine.
Comment #4
swentel CreditAttribution: swentel at eps & kaas commentedActually, I do see errors appearing in the logs, even though the attribute is printed, reopening.
Comment #5
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedThis fixes the notice
Comment #8
swentel CreditAttribution: swentel at eps & kaas for Dropsolid commentedcommitted and pushed!