diff --git a/core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php b/core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php index c149387..84dbbd7 100644 --- a/core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php +++ b/core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php @@ -196,10 +196,7 @@ protected function initializeView($match = NULL, $match_operator = 'CONTAINS', $ } $this->view->setDisplay($display_name); $this->view->initPager(); - $items_per_page = $this->view->getItemsPerPage(); - if (!empty($items_per_page)) { - $limit = $items_per_page; - } + $limit = $this->view->getItemsPerPage(); // Pass options to the display handler to make them available later. $entity_reference_options = [ diff --git a/core/modules/views/src/Plugin/views/display/EntityReference.php b/core/modules/views/src/Plugin/views/display/EntityReference.php index 30eb620..4dedd51 100644 --- a/core/modules/views/src/Plugin/views/display/EntityReference.php +++ b/core/modules/views/src/Plugin/views/display/EntityReference.php @@ -156,14 +156,6 @@ public function query() { $this->view->query->addWhere(0, $id_table . '.' . $id_field, $options['ids'], 'IN'); } - // If the display has no pager set (plugin ID equals 'none'), set one. - if ($this->view->getPager()->getPluginId() === 'none') { - /** @var \Drupal\views\Plugin\ViewsPluginManager $pager_plugin_manager */ - $pager_plugin_manager = \Drupal::service('plugin.manager.views.pager'); - /** @var \Drupal\views\Plugin\views\pager\PagerPluginBase $pager */ - $this->view->pager = $pager_plugin_manager->createInstance('some'); - $this->view->pager->init($this->view, $this->view->getDisplay()); - } $this->view->setItemsPerPage($options['limit']); }