Problem/Motivation

So I think this happened after updating to 8.6.0. I get several notices/warnings when on the "manage display" page for a content type's teaser view mode.

Steps to reproduce:

1. Install 8.6.0 with standard install profile
2. Enable Layout Builder
3. Go to the display settings for page content content type's DEFAULT view mode (/admin/structure/types/manage/page/display)
4. Enable Layout Builder AND overrides
5. Visit display settings for teaser view mode, and observe issues below:

Notice: Undefined index: parent_wrapper in Drupal\field_ui\Element\FieldUiTable::tablePreRender() (line 62 of core/modules/field_ui/src/Element/FieldUiTable.php).

Notice: Undefined index: #region_callback in Drupal\field_ui\Element\FieldUiTable::tablePreRender() (line 70 of core/modules/field_ui/src/Element/FieldUiTable.php).

Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in Drupal\field_ui\Element\FieldUiTable::tablePreRender() (line 70 of core/modules/field_ui/src/Element/FieldUiTable.php).

Notice: Undefined index: weight in Drupal\field_ui\Element\FieldUiTable::tablePreRender() (line 77 of core/modules/field_ui/src/Element/FieldUiTable.php).

Proposed resolution

Always hide the special layout field, since it should never be interacted with in that UI.

Remaining tasks

N/A

User interface changes

No more PHP notices!

API changes

N/A

Data model changes

N/A

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bkosborne created an issue. See original summary.

bkosborne’s picture

Title: Several PHP notices/warnings when managing display for teaser » PHP notices/warnings when managing display for non-default view mode when LB is enabled w/ overrides
bkosborne’s picture

Issue summary: View changes
tim.plunkett’s picture

I think I have a fix for this locally. Away from my laptop but I will update Sunday/Monday

tim.plunkett’s picture

Status: Active » Needs work
Issue tags: +Needs tests
FileSize
1.67 KB
tim.plunkett’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs tests +Blocks-Layouts, +sprint
FileSize
1.55 KB
3.22 KB

The FAIL patch is also the interdiff.

Before the opt-in patch landed, we completely wiped out $form['#fields'] and $form['fields'].
The opt-in patch attempted to conditionally alter the form based on the enabled-ness.
What that didn't consider is that enabled-ness was per-viewmode and yet the field we wanted to hide would show for the whole bundle.

The solution is to always hide the field, since it should never be interacted with in that UI.

The last submitted patch, 6: 2998215-lb-form-6-FAIL.patch, failed testing. View results

akash.addweb’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
22.66 KB
226.46 KB
13.71 KB

@tim.plunkett, I checked your updated patch in my local & it seems working fine to me. Thanks for Providing the steps to make RTBC easy for me.
PFA that shows after applying your patch, I didn't receive any error in my log.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed a228420963 to 8.7.x and a5c0256bed to 8.6.x. Thanks!

  • alexpott committed a228420 on 8.7.x
    Issue #2998215 by tim.plunkett, Ronak.addweb, bkosborne: PHP notices/...

  • alexpott committed a5c0256 on 8.6.x
    Issue #2998215 by tim.plunkett, Ronak.addweb, bkosborne: PHP notices/...

Status: Fixed » Closed (fixed)

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