Commit 75386772 authored by catch's avatar catch
Browse files

Issue #3410091 by mglaman, alexpott, smustgrave, bnjmnm, quietone:...

Issue #3410091 by mglaman, alexpott, smustgrave, bnjmnm, quietone: [regression] Menu List Builder  getEntityIds() no longer calls getEntityListQuery

(cherry picked from commit c257de99)
parent 3960a5d4
Loading
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -50,6 +50,14 @@ class EntityListBuilder extends EntityHandlerBase implements EntityListBuilderIn
   */
  protected $limit = 50;

  /**
   * The entity key to sort the list by.
   *
   * This can be overridden in child classes to sort the list by a different
   * entity key.
   */
  protected const SORT_KEY = 'id';

  /**
   * {@inheritdoc}
   */
@@ -108,7 +116,7 @@ protected function getEntityIds() {
  protected function getEntityListQuery(): QueryInterface {
    $query = $this->getStorage()->getQuery()
      ->accessCheck(TRUE)
      ->sort($this->entityType->getKey('id'));
      ->sort($this->entityType->getKey(static::SORT_KEY));

    // Only add the pager if a limit is specified.
    if ($this->limit) {
+1 −12
Original line number Diff line number Diff line
@@ -17,18 +17,7 @@ class MenuListBuilder extends ConfigEntityListBuilder {
  /**
   * {@inheritdoc}
   */
  protected function getEntityIds() {
    $query = $this
      ->getStorage()
      ->getQuery()
      ->sort('label', 'ASC');

    // Only add the pager if a limit is specified.
    if ($this->limit) {
      $query->pager($this->limit);
    }
    return $query->execute();
  }
  protected const SORT_KEY = 'label';

  /**
   * {@inheritdoc}