Commit 66ae877b authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2605214 by Gábor Hojtsy, ChuChuNaKu, EclipseGc, dawehner: Views...

Issue #2605214 by Gábor Hojtsy, ChuChuNaKu, EclipseGc, dawehner: Views InOperator::getValueOptions() children do not return values like InOperator::getValueOptions()

(cherry picked from commit 1546d71f)
parent 05f8dfcd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ public function getValueOptions() {
      CommentItemInterface::CLOSED => $this->t('Closed'),
      CommentItemInterface::OPEN => $this->t('Open'),
    );
    return $this->valueOptions;
  }

}
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ public function getValueOptions() {
    if (!isset($this->valueOptions)) {
      $this->valueOptions = _views_file_status();
    }
    return $this->valueOptions;
  }

}
+12 −0
Original line number Diff line number Diff line
@@ -45,6 +45,18 @@ public function testFilter() {
        'name' => $name,
      ));
      $this->assertIdenticalResultset($view, $expected, array('views_test_data_name' => 'name'));

      $expected = [
        '***LANGUAGE_site_default***',
        '***LANGUAGE_language_interface***',
        '***LANGUAGE_language_content***',
        'en',
        'xx-lolspeak',
        'und',
        'zxx'
      ];
      $this->assertIdentical(array_keys($view->filter['langcode']->getValueOptions()), $expected);

      $view->destroy();
    }
  }
+6 −1
Original line number Diff line number Diff line
@@ -89,7 +89,12 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o

  public function hasExtraOptions() { return TRUE; }

  public function getValueOptions() { /* don't overwrite the value options */ }
  /**
   * {@inheritdoc}
   */
  public function getValueOptions() {
    return $this->valueOptions;
  }

  protected function defineOptions() {
    $options = parent::defineOptions();
+6 −2
Original line number Diff line number Diff line
@@ -101,8 +101,12 @@ protected function valueSubmit($form, FormStateInterface $form_state) {
    // prevent array filter from removing our anonymous user.
  }

  // Override to do nothing.
  public function getValueOptions() { }
/**
 * {@inheritdoc}
 */
  public function getValueOptions() {
    return $this->valueOptions;
  }

  public function adminSummary() {
    // set up $this->valueOptions for the parent summary
Loading