diff --git a/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php b/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php index dc0ac923de49e3c6e7f7f79faadd308c61c507c1..3aed1ece8dccdbec5490200a25c6adc30f1b2830 100644 --- a/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php +++ b/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php @@ -34,6 +34,11 @@ abstract class DraggableListBuilder extends ConfigEntityListBuilder implements F */ protected $weightKey = FALSE; + /** + * {@inheritdoc} + */ + protected $limit = FALSE; + /** * The form builder. * diff --git a/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php b/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php new file mode 100644 index 0000000000000000000000000000000000000000..417e9f13cbf9546876e1a65f4d1ea3514c1a82c7 --- /dev/null +++ b/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php @@ -0,0 +1,49 @@ +<?php + +namespace Drupal\Tests\config\Functional; + +use Drupal\Tests\BrowserTestBase; +use Drupal\user\Entity\Role; + +/** + * Tests draggable list builder. + * + * @group config + */ +class ConfigDraggableListBuilderTest extends BrowserTestBase { + + /** + * {@inheritdoc} + */ + public static $modules = array('config_test'); + + /** + * Test draggable lists. + */ + public function testDraggableList() { + $this->drupalLogin($this->drupalCreateUser(array('administer permissions'))); + + // Create more than 50 roles. + for ($i = 0; $i < 51; $i++) { + $role = Role::create([ + 'id' => 'role_' . $i, + 'label' => "Role $i", + ]); + $role->save(); + } + + // Navigate to Roles page + $this->drupalGet('admin/people/roles'); + + // Test for the page title. + $this->assertSession()->titleEquals(t('Roles') . ' | Drupal'); + + // Count the number of rows in table. + $rows = $this->xpath('//form[@class="user-admin-roles-form"]/table/tbody/tr'); + $this->assertGreaterThan(50, count($rows)); + for ($i = 0; $i < 51; $i++) { + $this->assertSession()->pageTextContains("Role $i"); + } + } + +}