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)

Comments

inst created an issue. See original summary.

digdanlow’s picture

Hello! 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.

inst’s picture

Hi,
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.

inst’s picture

Hi,
did you get the chance to take a look to my post?

thanks in advance.

gausarts’s picture

Assigned: inst » Unassigned
Category: Support request » Bug report
Priority: Major » Normal
Status: Active » Needs review
StatusFileSize
new1.11 KB
new119.98 KB

Sorry 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 title being printed as seen in the screenshot.

Attached to just add a check with also a dummy nix.

  • gausarts committed cce39f2 on 8.x-1.x
    Issue #3157361 by gausarts, inst, digdanlow: Warning in Layout Builder
    
gausarts’s picture

Status: Needs review » Fixed

Committed. Thank you for contribution and patience.

inst’s picture

Hi gausarts,
big thanks for fixing this.
I really appreciate the module and your work for the Drupal community!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.