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
Comment | File | Size | Author |
---|---|---|---|
#8 | Notice_errors.png | 13.71 KB | akash.addweb |
#8 | Before_patch_notice_error.png | 226.46 KB | akash.addweb |
#8 | After_patch.png | 22.66 KB | akash.addweb |
#6 | 2998215-lb-form-6-PASS.patch | 3.22 KB | tim.plunkett |
#6 | 2998215-lb-form-6-FAIL.patch | 1.55 KB | tim.plunkett |
Comments
Comment #2
bkosborneComment #3
bkosborneComment #4
tim.plunkettI think I have a fix for this locally. Away from my laptop but I will update Sunday/Monday
Comment #5
tim.plunkettComment #6
tim.plunkettThe 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.
Comment #8
akash.addweb CreditAttribution: akash.addweb commented@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.
Comment #9
alexpottCommitted and pushed a228420963 to 8.7.x and a5c0256bed to 8.6.x. Thanks!