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

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

$
0
0

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 #2353611: Make it possible to link to an entity by UUID - 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


Viewing all articles
Browse latest Browse all 292800

Trending Articles



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