- Issue created by @interlated
The module linked_field → supports adding a link around fields with the related field being selectable from link fields in the bundle that the display relates to.
There is some logic to find the bundle in hook_field_formatter_settings_summary_alter
$bundle = $field_definition->getTargetBundle();
if (!$bundle) {
$bundle = $form['#bundle'] ?? NULL;
}
This works with layout builder for image fields, but not for title fields (generic fields, fields shared across bundles?).
Specific to linked_field, although this issue is related to the bundle information being passed to the hook generally
- install 'linked_field' composer require drupal/linked_field && drush en -y linked_field
- Create a link field on the content type.
- Edit a layout with layout builder. e.g. go to article.
- Place the title block in the layout
- Try to 'link this field'.
- result is 'no fields available'. The expected result is a select list with the link field listed.
The field settings form with an image
Title does not
Possibly similar issues - Create a link field on the content type.
it is impossible to check whether this issue happens when laying out fields without layout builder as you can't access title settings. The layout builder call stack seems to be called without 'Use Layout Builder' checked. Possibly the error is in 'Entity View'?
$plugin has the view_mode. Why not bundle?
- $field_definition has the bundle property set to null
- $form does not have a 'bundle' entry
$view_mode is also passed to the hook
Better still implement the event FIELD_FORMATTER_SETTINGS_SUMMARY_ALTER
Active
11.0 🔥
field_ui.module