Verified Commit 5df135d5 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3485650 by brandonlira, igorgoncalves, isa.bel, joachim, smustgrave:...

Issue #3485650 by brandonlira, igorgoncalves, isa.bel, joachim, smustgrave: DraggableListBuilder needs to document its expectations
parent f9563f61
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -10,6 +10,9 @@

/**
 * Defines a class to build a draggable listing of configuration entities.
 *
 * To enable this feature, the entity type must define a "weight" key in its
 * entity keys annotation.
 */
abstract class DraggableListBuilder extends ConfigEntityListBuilder implements FormInterface {

@@ -24,10 +27,12 @@ public function __construct(EntityTypeInterface $entity_type, EntityStorageInter
    // Do not inject the form builder for backwards-compatibility.
    $this->formBuilder = \Drupal::formBuilder();

    // Check if the entity type supports weighting.
    // Check if the entity type supports weighting and store the key.
    if ($this->entityType->hasKey('weight')) {
      $this->weightKey = $this->entityType->getKey('weight');
    }

    // Disable limit to load all entities for full drag-and-drop support.
    $this->limit = FALSE;
  }