diff -u b/core/lib/Drupal/Core/Ajax/AjaxResponse.php b/core/lib/Drupal/Core/Ajax/AjaxResponse.php --- b/core/lib/Drupal/Core/Ajax/AjaxResponse.php +++ b/core/lib/Drupal/Core/Ajax/AjaxResponse.php @@ -46,7 +46,7 @@ } /** - * Returns all the commands. + * Returns all the commands by reference. * * @return array * An array of ajax command arrays. diff -u b/core/modules/views/includes/ajax.inc b/core/modules/views/includes/ajax.inc --- b/core/modules/views/includes/ajax.inc +++ b/core/modules/views/includes/ajax.inc @@ -6,7 +6,7 @@ */ use Symfony\Component\HttpFoundation\JsonResponse; -use Drupal\views\Ajax\HiliteCommand; +use Drupal\views\Ajax\HighlightCommand; use Drupal\views\Ajax\SetFormCommand; use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\ReplaceCommand; @@ -138,7 +138,7 @@ $response->addCommand(new SetFormCommand($display, $title, $url)); if (!empty($form_state['#section'])) { - $response->addCommand(new HiliteCommand('.' . drupal_clean_css_identifier($form_state['#section']))); + $response->addCommand(new HighlightCommand('.' . drupal_clean_css_identifier($form_state['#section']))); } return $response; diff -u b/core/modules/views/js/ajax.js b/core/modules/views/js/ajax.js --- b/core/modules/views/js/ajax.js +++ b/core/modules/views/js/ajax.js @@ -42,7 +42,7 @@ $(Drupal.settings.views.ajax.popup).dialog('close'); }; - Drupal.ajax.prototype.commands.viewsHilite = function (ajax, response, status) { + Drupal.ajax.prototype.commands.viewsHighlight = function (ajax, response, status) { $('.hilited').removeClass('hilited'); $(response.selector).addClass('hilited'); }; reverted: --- b/core/modules/views/lib/Drupal/views/Ajax/HiliteCommand.php +++ /dev/null @@ -1,46 +0,0 @@ -selector = $selector; - } - - /** - * Implements \Drupal\Core\Ajax\CommandInterface::render(). - */ - public function render() { - return array( - 'command' => 'viewsHilite', - 'selector' => $this->selector, - ); - } - -} diff -u b/core/modules/views/lib/Drupal/views/Ajax/ShowButtonsCommand.php b/core/modules/views/lib/Drupal/views/Ajax/ShowButtonsCommand.php --- b/core/modules/views/lib/Drupal/views/Ajax/ShowButtonsCommand.php +++ b/core/modules/views/lib/Drupal/views/Ajax/ShowButtonsCommand.php @@ -10,7 +10,7 @@ use Drupal\Core\Ajax\CommandInterface; /** - * Provides an AJAX command for showing the save and cancel button. + * Provides an AJAX command for showing the save and cancel buttons. * * This command is implemented in Drupal.ajax.prototype.commands.viewsShowButtons. */ diff -u b/core/modules/views/views_ui/views_ui.module b/core/modules/views/views_ui/views_ui.module --- b/core/modules/views/views_ui/views_ui.module +++ b/core/modules/views/views_ui/views_ui.module @@ -693,8 +693,9 @@ // If the request is via AJAX, return the rendered list as JSON. if (drupal_container()->get('request')->request->get('js')) { $list = entity_list_controller('view')->render(); - $commands = array(ajax_command_replace('#views-entity-list', drupal_render($list))); - return new JsonResponse(ajax_render($commands)); + $response = new AjaxResponse(); + $response->addCommand(new ReplaceCommand('#views-entity-list', drupal_render($list))); + return $response; } // Otherwise, redirect back to the page. else { @@ -707,9 +708,8 @@ // If the request is via AJAX, return the rendered list as JSON. if (drupal_container()->get('request')->request->get('js')) { $list = entity_list_controller('view')->render(); - $response = new AjaxResponse(); - $response->addCommand(new ReplaceCommand('#views-entity-list', drupal_render($list))); - return $response; + $commands = array(ajax_command_replace('#views-entity-list', drupal_render($list))); + return new JsonResponse(ajax_render($commands)); } // Otherwise, redirect back to the page. else { only in patch2: unchanged: --- /dev/null +++ b/core/modules/views/lib/Drupal/views/Ajax/HighlightCommand.php @@ -0,0 +1,46 @@ +selector = $selector; + } + + /** + * Implements \Drupal\Core\Ajax\CommandInterface::render(). + */ + public function render() { + return array( + 'command' => 'viewsHighlight', + 'selector' => $this->selector, + ); + } + +}