Problem/Motivation
https://www.drupal.org/node/2406749#comment-9569221 - this patch left to use node path but we would like to use entity:uri.
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
| 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
Comments
Comment #1
yesct commentedhtml.
probably not upgrade path blocker
Comment #2
yesct commentedoops wrong place.
should be menu_ui_node_save() in
core/modules/menu_ui/menu_ui.module
Comment #3
yesct commentedadding D8 upgrade path tag since this would change what is being stored.
Comment #4
RavindraSingh commentedplease have a look before implementation
https://www.drupal.org/node/2406749#comment-9569795
Comment #5
amateescu commentedThis is a start... doesn't seem to work yet :/
Comment #7
kgoel commentedI am at NJ sprint and working on this.
Comment #8
kgoel commentedComment #9
kgoel commentedComment #10
yesct commented#2416955: Convert MenuLinkContent to use a link widget landed, can start on this.
Comment #13
yched commented#2417783: Remove widget specific logic in MenuLinkContentForm was marked as a duplicate. Not familiar enough with the problem space to fully grasp how entity: will fix the issue pointed there, but following with interest :-)
Comment #14
yesct commented@amateescu are you working on this right now? I was thinking of diving into it at the moment.
Comment #15
amateescu commented@YesCT, nope, but I think @kgoel is working on it. I just asked for a retest on the initial patch to see if the recent commits brought any improvements.
Comment #16
kgoel commentedYes, I am working on it right now.
Comment #17
kgoel commentedThis patch is going to fail. I am waiting for Wim to finish work on https://www.drupal.org/node/2417793 so I can apply his changes.
Comment #19
kgoel commentedMarking it as dupe of https://www.drupal.org/node/2417793