Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / web / core / modules / block_content / src / BlockContentListBuilder.php
index 96259173cdd04e093bd8c5af1871701feb1ee703..f254a764dc1dcc004c07ee66b09927d5d3ef4091 100644 (file)
@@ -4,7 +4,6 @@ namespace Drupal\block_content;
 
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityListBuilder;
-use Drupal\Core\Routing\RedirectDestinationTrait;
 
 /**
  * Defines a class to build a listing of custom block entities.
@@ -13,8 +12,6 @@ use Drupal\Core\Routing\RedirectDestinationTrait;
  */
 class BlockContentListBuilder extends EntityListBuilder {
 
-  use RedirectDestinationTrait;
-
   /**
    * {@inheritdoc}
    */
@@ -34,12 +31,16 @@ class BlockContentListBuilder extends EntityListBuilder {
   /**
    * {@inheritdoc}
    */
-  public function getDefaultOperations(EntityInterface $entity) {
-    $operations = parent::getDefaultOperations($entity);
-    if (isset($operations['edit'])) {
-      $operations['edit']['query']['destination'] = $this->getRedirectDestination()->get();
+  protected function getEntityIds() {
+    $query = $this->getStorage()->getQuery()
+      ->sort($this->entityType->getKey('id'));
+    $query->condition('reusable', TRUE);
+
+    // Only add the pager if a limit is specified.
+    if ($this->limit) {
+      $query->pager($this->limit);
     }
-    return $operations;
+    return $query->execute();
   }
 
 }