- Issue created by @RandalV
- π«π·France federiko_
"Edit the body field, and replace `body` in the URL with the layout field name: `layout_builder__layout`"
I am not sure to understand what is meaned there. Is it possible to have more details ?
- π§πͺBelgium RandalV
Hi frederiko_,
Certainly!
Editing the "body"-field will lead you to a URL like:
/admin/structure/types/manage/page/fields/node.page.body
Replace the last part (the field's machine name, in this case 'body'), with the locked field's machine name, for example:
/admin/structure/types/manage/page/fields/node.page.layout_builder__layout
And it'll give you the WSOD.
- π§πͺBelgium RandalV
The problem seems to be that in file
core/modules/field_ui/field_ui.module
,
The$form['field_storage']['subform']
doesn't seem to exist, in the function below.
I don't know what the correct solution would be.. I'd say the form still needs to be alterable, and we still need to trigger the alter hooks on the bottom./** * Implements hook_form_FORM_ID_alter() for field_config_edit_form. */ function field_ui_form_field_config_edit_form_alter(&$form, FormStateInterface $form_state) { if (!isset($form['field_storage']['subform'])) { return; } $field_config = $form_state->getFormObject()->getEntity(); assert($field_config instanceof FieldConfigInterface); $form_id = 'field_storage_config_edit_form'; $hook = 'form_' . $form_id; $field_storage_form = \Drupal::entityTypeManager()->getFormObject('field_storage_config', $form_state->getFormObject()->getOperation()); $field_storage_form->setEntity($field_config->getFieldStorageDefinition()); $subform_state = SubformState::createForSubform($form['field_storage']['subform'], $form, $form_state, $field_storage_form); \Drupal::moduleHandler()->alterDeprecated('Use hook_form_field_config_edit_form_alter() instead. See https://www.drupal.org/node/3386675.', $hook, $form['field_storage']['subform'], $subform_state, $form_id); \Drupal::theme()->alter($hook, $form['field_storage']['subform'], $subform_state, $form_id); }
- Status changed to Needs review
3 months ago 2:47am 6 August 2024 - π―π΅Japan kazuko.murata
I tried to work around this issue, and it seems to be resolved in Drupal 11.0.0 with fix π Remove deprecated code from field_ui Fixed .
The function field_ui_form_field_config_edit_form_alter(), which caused an error, has been removed by fix #3442361, and now displays "The field Layout is locked and cannot be edited".
I have attached a screenshot of the operation check, so I would be happy if anyone could verify it.
- Status changed to Needs work
3 months ago 1:32pm 6 August 2024 - Status changed to Active
3 months ago 10:03pm 6 August 2024