Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298064

MenuLinkContent's "menu_name" base field is a string field rather than an entity reference field

$
0
0

Problem/Motivation

First reported in #2977669: Spec Compliance: some entity types have an "id", "type" or "uuid" field, this violates the spec.

This makes it impossible to expose the relationship between MenuLinkContent and Menu entities:

    $fields['menu_name'] = BaseFieldDefinition::create('string')
      ->setLabel(t('Menu name'))
      ->setDescription(t('The menu name. All links with the same menu name (such as "tools") are part of the same menu.'))
      ->setDefaultValue('tools')
      ->setSetting('is_ascii', TRUE);

Proposed resolution

    $fields['menu'] = BaseFieldDefinition::create('entity_reference')
      ->setLabel(t('Menu'))
      ->setDescription(t('The menu this link is part of.');

Remaining tasks

TBD

User interface changes

TBd

API changes

TBD

Data model changes

Yes!


Viewing all articles
Browse latest Browse all 298064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>