/** * Handles form submission for the views block configuration form. * * @param \Drupal\views\Plugin\Block\ViewsBlock $block * The ViewsBlock plugin. * @param array $form * The form definition array for the full block configuration form. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. * * * @see \Drupal\views\Plugin\Block\ViewsBlock::blockSubmit() */ public function blockSubmit(ViewsBlock $block, $form, FormStateInterface $form_state) { if ($items_per_page = $form_state->getValue(array('override', 'items_per_page'))) { $block->setConfigurationValue('items_per_page', $items_per_page); } $form_state->unsetValue(array('override', 'items_per_page')); }
/** * Handles form submission for the views block configuration form. * * @param \Drupal\views\Plugin\Block\ViewsBlock $block * The ViewsBlock plugin. * @param array $form * The form definition array for the full block configuration form. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. * * * @see \Drupal\views\Plugin\Block\ViewsBlock::blockSubmit() */ public function blockSubmit(ViewsBlock $block, $form, FormStateInterface $form_state) { if (isset($form_state['values']['override']['items_per_page'])) { $block->setConfigurationValue('items_per_page', $form_state['values']['override']['items_per_page']); } }