':url' => Url::
fromRoute('entity.menu.add_link_form',
['menu' =>
$this->entity->
id()],
[ 'query' =>
['destination' =>
$this->entity->
toUrl('edit-form'
)->
toString()],
])->
toString(),
]);
$links =
$this->
buildOverviewTreeForm($tree,
$delta);
// Get the menu links which have pending revisions, and disable the
// tabledrag if there are any.
$edited_ids =
array_filter(array_map(function D
$element) { return is_array($element) &&
isset($element['#item'
]) &&
$element['#item'
]->link instanceof MenuLinkContent ?
$element['#item'
]->link->
getMetaData()['entity_id'
] : NULL;
},
$links));
$pending_menu_link_ids =
array_intersect($this->menuLinkContentStorage->
getMenuLinkIdsWithPendingRevisions(),
$edited_ids);
if ($pending_menu_link_ids) { $form['help'
] =
[ '#type' => 'container',
'message' =>
[ '#markup' =>
$this->
formatPlural( count($pending_menu_link_ids),
'%capital_name contains 1 menu link with pending revisions. Manipulation of a menu tree having links with pending revisions is not supported, but you can re-enable manipulation by getting each menu link to a published state.',
'%capital_name contains @count menu links with pending revisions. Manipulation of a menu tree having links with pending revisions is not supported, but you can re-enable manipulation by getting each menu link to a published state.',
[ '%capital_name' =>
$this->entity->
label(),
] ),