diff --git a/core/modules/views/src/Form/ViewsExposedForm.php b/core/modules/views/src/Form/ViewsExposedForm.php index 78079fdb5c..0647d00563 100644 --- a/core/modules/views/src/Form/ViewsExposedForm.php +++ b/core/modules/views/src/Form/ViewsExposedForm.php @@ -130,7 +130,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { // If we are building an ajax form, don't set the action to the views // ajax route. $current = Url::fromRoute(''); - if ($current->getRouteName() !== 'views.ajax') { + if ($this->getRouteMatch()->getRouteName() !== 'views.ajax') { $form_action = $current->toString(); } else {