diff --git a/core/modules/views/src/Controller/ViewAjaxController.php b/core/modules/views/src/Controller/ViewAjaxController.php index d204766f28..2e0ea1841f 100644 --- a/core/modules/views/src/Controller/ViewAjaxController.php +++ b/core/modules/views/src/Controller/ViewAjaxController.php @@ -142,7 +142,7 @@ public function ajaxView(Request $request) { throw new NotFoundHttpException(); } $view = $this->executableFactory->get($entity); - if ($view && $view->access($display_id) && $view->setDisplay($display_id) && $view->display_handler->getOption('use_ajax')) { + if ($view && $view->access($display_id) && $view->setDisplay($display_id) && $view->display_handler->ajaxEnabled()) { $response->setView($view); // Fix the current path for paging. if (!empty($path)) { diff --git a/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php b/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php index a02f098cda..822239f012 100644 --- a/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php +++ b/core/modules/views/tests/src/Unit/Controller/ViewAjaxControllerTest.php @@ -344,8 +344,7 @@ protected function setupValidMocks($use_ajax = self::USE_AJAX) { $display_handler->expects($this->never()) ->method('setOption'); $display_handler->expects($this->any()) - ->method('getOption') - ->with('use_ajax') + ->method('ajaxEnabled') ->willReturn($use_ajax); $display_collection = $this->getMockBuilder('Drupal\views\DisplayPluginCollection')