Problem/Motivation
Follow-up to #2406749-56: Use a link field for custom menu link
// Create a new menu_link_content entity.
$entity = entity_create('menu_link_content', array(
'title' => trim($definition['title']),
'description' => trim($definition['description']),
// @todo Replace it with entity: once possible.
'link' => ['uri' => 'node/' . $node->id()],
'menu_name' => $definition['menu_name'],
'parent' => $definition['parent'],
'weight' => isset($definition['weight']) ? $definition['weight'] : 0,
'enabled' => 1,
'langcode' => $node->getUntranslated()->language()->getId(),
));
#2411333: Create standard logic to handle a entity: URI scheme is in
so use it.
The tests around this could be tricky.
Proposed resolution
Use entity:
Remaining tasks
Task | Novice task? | Contributor instructions | Complete? |
---|---|---|---|
Create a patch | Instructions | ||
Update the issue summary noting if allowed during the beta | Instructions | ||
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards | Instructions |
User interface changes
No
API changes
No