Cannot link title to a field. Bundle is not passed to hook_field_formatter_settings_summary_alter

Created on 4 October 2024, 6 months ago

Problem/Motivation

I cannot use the 'Field' option when linking from a title field. The formatter is 'plain text'. This is with LayoutBuilder, it is not possible to set field formatting options on title in the default display form.

Looking at linked_field.module line 131 the bundle is not resolved with the Title field.

It looks as though layout builder isn't nice in passing the bundle.
https://www.drupal.org/project/drupal/issues/3279716

I've created an issue at https://www.drupal.org/project/drupal/issues/3478405 🐛 Bundle is not passed to hook_field_formatter_settings_summary_alter Active

Within 'linked_field' I could create a hack which pulls the bundle from the path.

Steps to reproduce

Proposed resolution

This is a hack

  // /admin/structure/types/manage/article/display/teaser_sidebar/layout
  if (!$bundle) {
    $path = explode("/", (\Drupal::request())->getPathInfo());
    $view_mode = $path[5];
    $view_mode_parts = explode('.', $view_mode);
    if (count($view_mode_parts) > 2) {
      $bundle = $view_mode_parts[1];
    }
  }

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇦🇺Australia interlated

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024