// AJAX happens via HTTP POST but everything expects exposed data to
// be in GET. Copy stuff but remove ajax-framework specific keys.
// If we're clicking on links in a preview, though, we could actually
// have some input in the query parameters, so we merge request() and
// query() to ensure we get it all.
$exposed_input =
array_merge(\Drupal::
request()->request->
all(), \Drupal::
request()->query->
all());
foreach (['view_name', 'view_display_id', 'view_args', 'view_path', 'view_dom_id', 'pager_element', 'view_base_path', AjaxResponseSubscriber::AJAX_REQUEST_PARAMETER, 'ajax_page_state', 'form_id', 'form_build_id', 'form_token'
] as $key) { if (isset($exposed_input[$key])) { unset($exposed_input[$key]);
} } $executable->
setExposedInput($exposed_input);
if (!
$executable->
setDisplay($display_id)) { return [ '#markup' =>
t('Invalid display id @display',
['@display' =>
$display_id]),
];
} $executable->
setArguments($args);
// Store the current view URL for later use:
if ($executable->
hasUrl() &&
$executable->display_handler->
getOption('path'
)) {