MenuLinkContent entities pointing to nodes are not deployable: LinkItem should have a "target_uuid" computed property

Created on 30 September 2015, about 9 years ago
Updated 21 February 2023, almost 2 years ago

Problem/Motivation

Menu link content entities when normalized contain references to node serial IDs (nid) and not UUIDs, this means they cannot be deployed.
Snippet:

...
  ],
    "link": [
        {
            "uri": "entity:node\/2",
            "title": null,
            "options": []
        }
    ],
...

Proposed resolution

Add new normalizers to menu_link_content.module for when hal and serialization modules are enabled to handle normalizing MenuLinkContent entities.

The normalizer should include the entity UUID in the normalized output and then use that to lookup the entity when denormalizing, ensuring that the link references the right entity.

Note this works alongside Make it possible to link to an entity by UUID Active - as allowing links to entities via UUIDs is useful in body text and other methods of linking, not just for menu links.

Also related is #2315773: Create a menu link field type/widget/formatter which seeks to make the relationship between an entity and it's menu link a first-class entity reference, however that may need to wait until D9 because of API breaks.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Feature request
Status

Needs work

Version

10.1

Component
Menu link content 

Last updated 1 day ago

Created by

🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

Live updates comments and jobs are added and updated live.
  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States smustgrave

    The new functions being added should be typehinted.

    Can the issue summary please be updated. The proposed solution mentions hal which isn't in core anymore.

    Change record was created in 2016 so probably needs an update as well.

    Would be worth pointing out if this has any affect on core or if this allowing contrib modules to export menu links.

Production build 0.71.5 2024