Hi,
when I enable the field in layout builder I got 2 error warnings. In the frontend everything is fine.
What can I do to avoid this?
thanks for help!
-------------
Notice: Undefined index: title in Drupal\linkicon\Plugin\Field\FieldFormatter\LinkIconFormatter->prepareView() (line 86 of modules/contrib/linkicon/src/Plugin/Field/FieldFormatter/LinkIconFormatter.php).
Drupal\linkicon\Plugin\Field\FieldFormatter\LinkIconFormatter->prepareView(Array) (Line: 245)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array) (Line: 267)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple(Array) (Line: 221)
Drupal\Core\Entity\Entity\EntityViewDisplay->build(Object) (Line: 472)
Drupal\Core\Entity\EntityViewBuilder->viewField(Object, Array) (Line: 243)
Drupal\Core\Field\FieldItemList->view(Array) (Line: 162)
Drupal\layout_builder\Plugin\Block\FieldBlock->build() (Line: 105)
Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray->onBuildRender(Object, 'section_component.build.render_array', Object)
call_user_func(Array, Object, 'section_component.build.render_array', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('section_component.build.render_array', Object) (Line: 90)
Drupal\layout_builder\SectionComponent->toRenderArray(Array, 1) (Line: 86)
Drupal\layout_builder\Section->toRenderArray(Array, 1) (Line: 250)
Drupal\layout_builder\Element\LayoutBuilder->buildAdministrativeSection(Object, 1) (Line: 123)
Drupal\layout_builder\Element\LayoutBuilder->layout(Object) (Line: 97)
Drupal\layout_builder\Element\LayoutBuilder->preRender(Array)
call_user_func_array(Array, Array) (Line: 100)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725', 'silenced_deprecation', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 781)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 372)
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)
Notice: Undefined index: title in Drupal\linkicon\Plugin\Field\FieldFormatter\LinkIconFormatter->prepareView() (line 87 of modules/contrib/linkicon/src/Plugin/Field/FieldFormatter/LinkIconFormatter.php).
Drupal\linkicon\Plugin\Field\FieldFormatter\LinkIconFormatter->prepareView(Array) (Line: 245)
Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple(Array) (Line: 267)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple(Array) (Line: 221)
Drupal\Core\Entity\Entity\EntityViewDisplay->build(Object) (Line: 472)
Drupal\Core\Entity\EntityViewBuilder->viewField(Object, Array) (Line: 243)
Drupal\Core\Field\FieldItemList->view(Array) (Line: 162)
Drupal\layout_builder\Plugin\Block\FieldBlock->build() (Line: 105)
Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray->onBuildRender(Object, 'section_component.build.render_array', Object)
call_user_func(Array, Object, 'section_component.build.render_array', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('section_component.build.render_array', Object) (Line: 90)
Drupal\layout_builder\SectionComponent->toRenderArray(Array, 1) (Line: 86)
Drupal\layout_builder\Section->toRenderArray(Array, 1) (Line: 250)
Drupal\layout_builder\Element\LayoutBuilder->buildAdministrativeSection(Object, 1) (Line: 123)
Drupal\layout_builder\Element\LayoutBuilder->layout(Object) (Line: 97)
Drupal\layout_builder\Element\LayoutBuilder->preRender(Array)
call_user_func_array(Array, Array) (Line: 100)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. Support for this callback implementation is deprecated in 8.8.0 and will be removed in Drupal 9.0.0. See https://www.drupal.org/node/2966725', 'silenced_deprecation', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 781)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 372)
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)
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | lb-Screenshot from 2021-06-18 10-28-43.png | 119.98 KB | gausarts |
| #5 | 3157361-lb-title-5.patch | 1.11 KB | gausarts |
Comments
Comment #2
digdanlow commentedHello! Please provide more details (drupal core and module version, field configuration, field formatter configuration, how are you using it with layout builder).
I tested on drupal core 8.9.1 with the module version 1.5.0 and I added a link icon field in layout builder and got no warnings.
Comment #3
inst commentedHi,
I am on Drupal 8.9.1 and Link Icon module version: 8.x-1.5
So what I did so far:
1) I put a multiple link field to my content type
2) Activated the link icon module
3) I configured my field like this: use only extern links an used the predefined option
4) I added this allowed link texts:
external-link-alt|Webseite
facebook|Facebook
twitter|Twitter
vimeo|Vimeo
youtube|Youtube
soundcloud|Soundcloud
bandcamp|Bandcamp
5) In layout builder I added the link field with the option display format "link" and saved - no error occured
6) In layout builder I switched to the option display format "Lin icon, based on titel" and saved - the error is displayed
7) here my other setting in layout builder for the link field:
- Icon prefix class: fa
- yes -> Allow linkicon to provide CSS assets
- Visually hide the title text
- Icon font size - middle
AND I saw in the status report I got the warning that my field with the link should be updated.
well thats it.
Comment #4
inst commentedHi,
did you get the chance to take a look to my post?
thanks in advance.
Comment #5
gausarts commentedSorry for delay and thank you.
> In the frontend everything is fine.
Indeed, the default layout builder only provide a very limited dummy link properties without
titlebeing printed as seen in the screenshot.Attached to just add a check with also a dummy
nix.Comment #7
gausarts commentedCommitted. Thank you for contribution and patience.
Comment #8
inst commentedHi gausarts,
big thanks for fixing this.
I really appreciate the module and your work for the Drupal community!