Loading core/modules/views/src/Plugin/views/filter/Bundle.php +1 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ public function getValueOptions() { $options[$type] = $info['label']; } array_multisort($options, SORT_ASC, SORT_REGULAR, array_keys($options)); asort($options); $this->valueOptions = $options; } Loading core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_type_filter.yml +1 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ display: field: type relationship: none value: 180575: '180575' test_bundle: test_bundle test_bundle_2: test_bundle_2 plugin_id: bundle Loading core/modules/views/tests/src/Kernel/Entity/FilterEntityBundleTest.php +5 −3 Original line number Diff line number Diff line Loading @@ -30,15 +30,16 @@ class FilterEntityBundleTest extends ViewsKernelTestBase { public function testFilterEntity() { $this->installEntitySchema('user'); $this->installEntitySchema('node'); NodeType::create(['type' => 'test_bundle'])->save(); NodeType::create(['type' => 'test_bundle_2'])->save(); NodeType::create(['type' => 'test_bundle', 'name' => 'Test 1'])->save(); NodeType::create(['type' => 'test_bundle_2', 'name' => 'Test 2'])->save(); NodeType::create(['type' => '180575', 'name' => '180575'])->save(); $bundle_info = $this->container->get('entity_type.bundle.info')->getBundleInfo('node'); $entities['count'] = 0; foreach ($bundle_info as $key => $info) { for ($i = 0; $i < 5; $i++) { for ($i = 0; $i < 3; $i++) { $entity = Node::create([ 'title' => $this->randomString(), 'uid' => 1, Loading @@ -54,6 +55,7 @@ public function testFilterEntity() { // Tests \Drupal\views\Plugin\views\filter\Bundle::calculateDependencies(). $expected = [ 'config' => [ 'node.type.180575', 'node.type.test_bundle', 'node.type.test_bundle_2', ], Loading Loading
core/modules/views/src/Plugin/views/filter/Bundle.php +1 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ public function getValueOptions() { $options[$type] = $info['label']; } array_multisort($options, SORT_ASC, SORT_REGULAR, array_keys($options)); asort($options); $this->valueOptions = $options; } Loading
core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_type_filter.yml +1 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ display: field: type relationship: none value: 180575: '180575' test_bundle: test_bundle test_bundle_2: test_bundle_2 plugin_id: bundle Loading
core/modules/views/tests/src/Kernel/Entity/FilterEntityBundleTest.php +5 −3 Original line number Diff line number Diff line Loading @@ -30,15 +30,16 @@ class FilterEntityBundleTest extends ViewsKernelTestBase { public function testFilterEntity() { $this->installEntitySchema('user'); $this->installEntitySchema('node'); NodeType::create(['type' => 'test_bundle'])->save(); NodeType::create(['type' => 'test_bundle_2'])->save(); NodeType::create(['type' => 'test_bundle', 'name' => 'Test 1'])->save(); NodeType::create(['type' => 'test_bundle_2', 'name' => 'Test 2'])->save(); NodeType::create(['type' => '180575', 'name' => '180575'])->save(); $bundle_info = $this->container->get('entity_type.bundle.info')->getBundleInfo('node'); $entities['count'] = 0; foreach ($bundle_info as $key => $info) { for ($i = 0; $i < 5; $i++) { for ($i = 0; $i < 3; $i++) { $entity = Node::create([ 'title' => $this->randomString(), 'uid' => 1, Loading @@ -54,6 +55,7 @@ public function testFilterEntity() { // Tests \Drupal\views\Plugin\views\filter\Bundle::calculateDependencies(). $expected = [ 'config' => [ 'node.type.180575', 'node.type.test_bundle', 'node.type.test_bundle_2', ], Loading