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

Use entity: in menu_ui_node_save() instead of 'link' => ['uri' => 'node/' . $node->id()],

$
0
0

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

Contributor tasks needed
TaskNovice task?Contributor instructionsComplete?
Create a patchInstructions
Update the issue summary noting if allowed during the betaInstructions
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standardsInstructions

User interface changes

No

API changes

No


Viewing all articles
Browse latest Browse all 298231

Trending Articles