Unverified Commit 8ff460a0 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3204140 by jonathanshaw, catch: EntityQuery accessCheck:...

Issue #3204140 by jonathanshaw, catch: EntityQuery accessCheck: menu_ui_get_menu_link_defaults() should not be access sensitive

(cherry picked from commit 1291450a)
parent 776e19dd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@ function menu_ui_get_menu_link_defaults(NodeInterface $node) {
    $type_menus = $node_type->getThirdPartySetting('menu_ui', 'available_menus', ['main']);
    if (in_array($menu_name, $type_menus)) {
      $query = \Drupal::entityQuery('menu_link_content')
        ->accessCheck(TRUE)
        ->condition('link.uri', 'node/' . $node->id())
        ->condition('menu_name', $menu_name)
        ->sort('id', 'ASC')
@@ -150,6 +151,7 @@ function menu_ui_get_menu_link_defaults(NodeInterface $node) {
    // Check all allowed menus if a link does not exist in the default menu.
    if (!$id && !empty($type_menus)) {
      $query = \Drupal::entityQuery('menu_link_content')
        ->accessCheck(TRUE)
        ->condition('link.uri', 'entity:node/' . $node->id())
        ->condition('menu_name', array_values($type_menus), 'IN')
        ->sort('id', 'ASC')