When attempting to manage the layout of a page using Layout Builder, the following errors are thrown.

Notice: Undefined index: display_id in Drupal\viewfield\Plugin\Field\FieldFormatter\ViewfieldFormatterDefault->viewElements() (line 130 of modules/custom/viewfield/src/Plugin/Field/FieldFormatter/ViewfieldFormatterDefault.php).

Notice: Undefined index: arguments in Drupal\viewfield\Plugin\Field\FieldFormatter\ViewfieldFormatterDefault->viewElements() (line 131 of modules/custom/viewfield/src/Plugin/Field/FieldFormatter/ViewfieldFormatterDefault.php).

Determine how to display a placeholder for Viewfields and correct these errors.

Comments

jerdavis created an issue. See original summary.

  • jerdavis committed 3c7781b on 8.x-3.x
    Issue #3071383 by jerdavis: Viewfield throws Undefined Index errors when...
jerdavis’s picture

Status: Needs work » Fixed

Added conditionals to viewElements(). This results in an empty element when sufficient information isn't available and renders a placeholder. If you're controlling layout of an individual piece of content you see the view results as expected.

Status: Fixed » Closed (fixed)

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