menu_link_content entities should export linked dependencies

Created on 3 January 2023, over 1 year ago
Updated 4 May 2023, about 1 year ago

Problem/Motivation

Not sure about wether this is a feature request or a bug that was supposed to be working but it is not.

When exporting a menu_link_content entity that links to an entity (a node, for example) using drush dcer, the dependency is correctly added to the result:

  depends:
    d5a07b5d-df96-49e7-9260-f937d889b870: menu_link_content
    83a5b1ab-5cb5-40c2-9e82-cc9735aeeacd: node

Nevertheless, I was expecting to have the dependeee node exported as well, the same way drush dcer will export any dependencies on entity references. It is not.

This is relevant as it will break any menu_link_content import due to the missing dependency.

Steps to reproduce

- Create a menu link content entity whose link field points to an internal Drupal entity
- Export the menu link content entity using drush dcer
- As a result, the yml file will correctly indicate the dependency on the other entity but this entity won't be exported
- When importing the menu_link_content, an error will occur because of the missing dependency.

Proposed resolution

Treat the link field on menu_link_content entities as an entity reference when it points to an internal entity (when link.uri is akin to entity:node/719), thus exporting the referenced entity as well.

Remaining tasks

All of it

User interface changes

None

API changes

None

Data model changes

None

✨ Feature request
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain idiaz.roncero Madrid

Live updates comments and jobs are added and updated live.
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.

Production build 0.69.0 2024