diff --git a/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php b/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php index 047d402..b88e110 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php +++ b/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php @@ -50,7 +50,6 @@ protected function defineOptions() { $options['allow'] = array( 'contains' => array( 'items_per_page' => array('default' => TRUE), - 'more_link' => array('default' => TRUE), ), ); @@ -71,7 +70,6 @@ protected function defineOptions() { */ public function blockSettings(array $settings) { $settings['items_per_page'] = 'none'; - $settings['more_link'] = 'none'; return $settings; } @@ -248,15 +246,6 @@ public function submitOptionsForm(&$form, &$form_state) { public function blockForm(ViewsBlock $block, array &$form, array &$form_state) { $allow_settings = array_filter($this->getOption('allow')); - if (!empty($allow_settings)) { - $form['override'] = array( - '#type' => 'details', - '#title' => t('Override settings'), - '#open' => TRUE, - '#weight' => 8, - ); - } - $block_configuration = $block->getConfig(); foreach ($allow_settings as $type => $enabled) { @@ -278,18 +267,6 @@ public function blockForm(ViewsBlock $block, array &$form, array &$form_state) { '#default_value' => $block_configuration['items_per_page'], ); break; - case 'more_link': - $form['override']['more_link'] = array( - '#type' => 'select', - '#title' => t('More link'), - '#options' => array( - 'none' => t('Use default settings'), - 0 => t('No more link'), - 1 => t('Display more link'), - ), - '#default_value' => $block_configuration['more_link'], - ); - break; } } @@ -327,9 +304,6 @@ public function blockSubmit(ViewsBlock $block, $form, &$form_state) { if (isset($form_state['values']['override']['items_per_page'])) { $block->setConfig('items_per_page', $form_state['values']['override']['items_per_page']); } - if (isset($form_state['values']['override']['more_link'])) { - $block->setConfig('more_link', $form_state['values']['override']['more_link']); - } } /** @@ -343,15 +317,6 @@ public function preBlockBuild(ViewsBlock $block) { if ($config['items_per_page'] !== 'none') { $this->view->setItemsPerPage($config['items_per_page']); } - - if ($config['more_link'] !== 'none') { - if ((int) $config['more_link'] == 0) { - $this->setOption('use_more', FALSE); - } - elseif ((int) $config['more_link'] == 1) { - $this->setOption('use_more', TRUE); - } - } } /** diff --git a/core/modules/block/tests/lib/Drupal/block/Tests/Plugin/views/display/BlockTest.php b/core/modules/block/tests/lib/Drupal/block/Tests/Plugin/views/display/BlockTest.php index 837308d..489d607 100644 --- a/core/modules/block/tests/lib/Drupal/block/Tests/Plugin/views/display/BlockTest.php +++ b/core/modules/block/tests/lib/Drupal/block/Tests/Plugin/views/display/BlockTest.php @@ -81,7 +81,7 @@ public function testBuildNoOverride() { $this->blockPlugin->expects($this->once()) ->method('getConfig') - ->will($this->returnValue(array('items_per_page' => 'none', 'more_link' => 'none'))); + ->will($this->returnValue(array('items_per_page' => 'none'))); $this->blockDisplay->preBlockBuild($this->blockPlugin); @@ -89,7 +89,7 @@ public function testBuildNoOverride() { } /** - * Tests the build method with overriding items per page and the more link. + * Tests the build method with overriding items per page. */ public function testBuildOverride() { $this->executable->expects($this->once()) @@ -98,11 +98,9 @@ public function testBuildOverride() { $this->blockPlugin->expects($this->once()) ->method('getConfig') - ->will($this->returnValue(array('items_per_page' => 5, 'more_link' => 1))); + ->will($this->returnValue(array('items_per_page' => 5))); $this->blockDisplay->preBlockBuild($this->blockPlugin); - - $this->assertTrue((bool) $this->blockDisplay->getOption('use_more')); } }