Unverified Commit 1291450a authored by alexpott's avatar alexpott
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
parent 2951df5d
...@@ -139,6 +139,7 @@ function menu_ui_get_menu_link_defaults(NodeInterface $node) { ...@@ -139,6 +139,7 @@ function menu_ui_get_menu_link_defaults(NodeInterface $node) {
$type_menus = $node_type->getThirdPartySetting('menu_ui', 'available_menus', ['main']); $type_menus = $node_type->getThirdPartySetting('menu_ui', 'available_menus', ['main']);
if (in_array($menu_name, $type_menus)) { if (in_array($menu_name, $type_menus)) {
$query = \Drupal::entityQuery('menu_link_content') $query = \Drupal::entityQuery('menu_link_content')
->accessCheck(TRUE)
->condition('link.uri', 'node/' . $node->id()) ->condition('link.uri', 'node/' . $node->id())
->condition('menu_name', $menu_name) ->condition('menu_name', $menu_name)
->sort('id', 'ASC') ->sort('id', 'ASC')
...@@ -150,6 +151,7 @@ function menu_ui_get_menu_link_defaults(NodeInterface $node) { ...@@ -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. // Check all allowed menus if a link does not exist in the default menu.
if (!$id && !empty($type_menus)) { if (!$id && !empty($type_menus)) {
$query = \Drupal::entityQuery('menu_link_content') $query = \Drupal::entityQuery('menu_link_content')
->accessCheck(TRUE)
->condition('link.uri', 'entity:node/' . $node->id()) ->condition('link.uri', 'entity:node/' . $node->id())
->condition('menu_name', array_values($type_menus), 'IN') ->condition('menu_name', array_values($type_menus), 'IN')
->sort('id', 'ASC') ->sort('id', 'ASC')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment