Programmatically add filter and it's value doesn't passed into ajax pagers.
When clicked to second page of ajax pager the programmatically added filters are gone. Is there a way ?
here's my code.

    $views = Views::getView('view_name');
    $views->setDisplay();
    $views->addHandler(
      $views->current_display,
      'filter',
      'table',
      'field',
      array(
        'operator' => '=',
        'value' => array(
          'min' => '',
          'max' => '',
          'value' => 3,
        ),
      )
    );

    $views->preExecute();
    $views->execute();

Comments

thihathit created an issue. See original summary.

thihathit’s picture

Status: Active » Closed (duplicate)

Created new on Drupal core https://www.drupal.org/node/2921070

mustanggb’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.4.x-dev
Component: Miscellaneous » views.module