Problem/Motivation

In a project I just found the following snippet:

/**
 * Implements hook_entity_type_alter to add views menu-link support.
 *
 * @return void
 */
function MY_MODULE_entity_type_alter(array &$entity_types)
{
  /** @var \Drupal\Core\Entity\EntityTypeInterface $menu_link_content */
  $menu_link_content = $entity_types['menu_link_content'];
  if (!$menu_link_content->hasHandlerClass('views_data')) {
    $menu_link_content->setHandlerClass('views_data', 'Drupal\views\EntityViewsData');
  }
}

Maybe that would be a helpful first step here? I didn't take a deeper look yet, if it really works and successfully exposes the fields in views. Guess maybe the relation is still missing then?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

anybody created an issue. See original summary.

anybody’s picture

MAYBE that could even be combined with the implementation from https://www.drupal.org/project/views_menu_relationship ?

If that makes sense... to connect nodes with the views data entity handler?

anybody’s picture

Assigned: grevil » anybody

I'll check #2 and the draft asap.