diff --git a/src/Plugin/views/field/IntegerWeightSelector.php b/src/Plugin/views/field/IntegerWeightSelector.php index 141d3567b..60892c960 100644 --- a/src/Plugin/views/field/IntegerWeightSelector.php +++ b/src/Plugin/views/field/IntegerWeightSelector.php @@ -46,12 +46,13 @@ public function viewsForm(array &$form, FormStateInterface $form_state) { $options[$this->getValue($row)] = $this->getValue($row); } - // If we were given some blank values we need to fill + // If we were given some blank values, or less than the + // total_rows for the view, we need to fill // out the option list from 1 through the result count // to make sure we have enough. (Blanks should only appear // at the beginning of the results list.) // Also, blank values will break the selector, remove it. - if (array_key_exists('', $options)) { + if (array_key_exists('', $options) || (count($options) < $this->view->total_rows)) { unset($options['']); for ($i = 1; $i <= $this->view->total_rows; $i++) { $options[$i] = $i;