Loading admin_toolbar_search/src/SearchLinks.php +6 −1 Original line number Diff line number Diff line Loading @@ -120,7 +120,12 @@ class SearchLinks { $content_entity = $entities['content_entity']; // Load the remaining items that were not loaded by the toolbar. $content_entity_bundle_storage = $this->entityTypeManager->getStorage($content_entity_bundle); $bundles_ids = $content_entity_bundle_storage->getQuery()->accessCheck()->sort('weight')->range($max_bundle_number)->execute(); $bundles_ids = $content_entity_bundle_storage->getQuery() ->accessCheck() ->sort('weight') ->sort($this->entityTypeManager->getDefinition($content_entity_bundle)->getKey('label')) ->range($max_bundle_number) ->execute(); if (!empty($bundles_ids)) { $bundles = $this->entityTypeManager ->getStorage($content_entity_bundle) Loading admin_toolbar_search/tests/src/FunctionalJavascript/AdminToolbarToolsSearchTest.php +7 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,13 @@ class AdminToolbarToolsSearchTest extends AdminToolbarSearchTestBase { // Test that bundle within admin toolbar appears in search. $this->assertSuggestionContains('lola', 'admin/structure/media/manage/lola/fields'); // Assert that a link after the limit doesn't appear in admin toolbar. $zora_url = '/admin/structure/media/manage/zora/fields'; $assert_session->elementNotContains('css', '#toolbar-administration', $zora_url); // Assert that a link excluded from admin toolbar appears in search. $this->assertSuggestionContains('zora', $zora_url); // Test that adding a new bundle updates the extra links loaded from // admin_toolbar.search route. $this->createMediaType('image', [ Loading admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php +6 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,12 @@ class ExtraLinks extends DeriverBase implements ContainerDeriverInterface { $content_entity_bundle = $entities['content_entity_bundle']; $content_entity = $entities['content_entity']; $content_entity_bundle_storage = $this->entityTypeManager->getStorage($content_entity_bundle); $bundles_ids = $content_entity_bundle_storage->getQuery()->accessCheck()->sort('weight')->pager($max_bundle_number)->execute(); $bundles_ids = $content_entity_bundle_storage->getQuery() ->accessCheck() ->sort('weight') ->sort($this->entityTypeManager->getDefinition($content_entity_bundle)->getKey('label')) ->pager($max_bundle_number) ->execute(); $bundles = $this->entityTypeManager->getStorage($content_entity_bundle)->loadMultiple($bundles_ids); if (count($bundles) == $max_bundle_number && $this->routeExists('entity.' . $content_entity_bundle . '.collection')) { $links[$content_entity_bundle . '.collection'] = [ Loading Loading
admin_toolbar_search/src/SearchLinks.php +6 −1 Original line number Diff line number Diff line Loading @@ -120,7 +120,12 @@ class SearchLinks { $content_entity = $entities['content_entity']; // Load the remaining items that were not loaded by the toolbar. $content_entity_bundle_storage = $this->entityTypeManager->getStorage($content_entity_bundle); $bundles_ids = $content_entity_bundle_storage->getQuery()->accessCheck()->sort('weight')->range($max_bundle_number)->execute(); $bundles_ids = $content_entity_bundle_storage->getQuery() ->accessCheck() ->sort('weight') ->sort($this->entityTypeManager->getDefinition($content_entity_bundle)->getKey('label')) ->range($max_bundle_number) ->execute(); if (!empty($bundles_ids)) { $bundles = $this->entityTypeManager ->getStorage($content_entity_bundle) Loading
admin_toolbar_search/tests/src/FunctionalJavascript/AdminToolbarToolsSearchTest.php +7 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,13 @@ class AdminToolbarToolsSearchTest extends AdminToolbarSearchTestBase { // Test that bundle within admin toolbar appears in search. $this->assertSuggestionContains('lola', 'admin/structure/media/manage/lola/fields'); // Assert that a link after the limit doesn't appear in admin toolbar. $zora_url = '/admin/structure/media/manage/zora/fields'; $assert_session->elementNotContains('css', '#toolbar-administration', $zora_url); // Assert that a link excluded from admin toolbar appears in search. $this->assertSuggestionContains('zora', $zora_url); // Test that adding a new bundle updates the extra links loaded from // admin_toolbar.search route. $this->createMediaType('image', [ Loading
admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php +6 −1 Original line number Diff line number Diff line Loading @@ -111,7 +111,12 @@ class ExtraLinks extends DeriverBase implements ContainerDeriverInterface { $content_entity_bundle = $entities['content_entity_bundle']; $content_entity = $entities['content_entity']; $content_entity_bundle_storage = $this->entityTypeManager->getStorage($content_entity_bundle); $bundles_ids = $content_entity_bundle_storage->getQuery()->accessCheck()->sort('weight')->pager($max_bundle_number)->execute(); $bundles_ids = $content_entity_bundle_storage->getQuery() ->accessCheck() ->sort('weight') ->sort($this->entityTypeManager->getDefinition($content_entity_bundle)->getKey('label')) ->pager($max_bundle_number) ->execute(); $bundles = $this->entityTypeManager->getStorage($content_entity_bundle)->loadMultiple($bundles_ids); if (count($bundles) == $max_bundle_number && $this->routeExists('entity.' . $content_entity_bundle . '.collection')) { $links[$content_entity_bundle . '.collection'] = [ Loading