Problem/Motivation

Steps to reproduce:

  1. Enable ajax on the /admin/content view
  2. Create at least a article and page node
  3. Filter by article
  4. Edit the one article
  5. Hit save
  6. Expected: you are back to /admin/content
  7. Actual result: you get the json result

Proposed resolution

Exclude some magic properties from the destination query.

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner created an issue. See original summary.

dawehner’s picture

Status: Active » Needs review
FileSize
2.12 KB

Here is a fix. Another issue which could profit quite a lot from javascript testing.

damiankloip’s picture

This fix seems OK to me. We don;t have another way of excluding these query params. Yet..

tim.plunkett’s picture

+++ b/core/modules/views/src/Controller/ViewAjaxController.php
@@ -161,7 +161,13 @@ public function ajaxView(Request $request) {
+        unset($used_query_parameters['_wrapper_format'], $used_query_parameters['ajax_page_state']);

This could have an @todo pointing to #2504709: Prevent _wrapper_format and ajax_form parameters from bleeding through to generated URLs
Also should use the constant \Drupal\Core\EventSubscriber\MainContentViewSubscriber::WRAPPER_FORMAT.

dawehner’s picture

There we go.

Thank you for the feedback!

dawehner’s picture

Just a ordinary rebase.

jibran’s picture

Status: Needs review » Reviewed & tested by the community

Let's be bold here.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 3049685 and pushed to 8.0.x and 8.1.x. Thanks!

@jibran that rtbc comment does not exactly explain how you've reviewed the code and passes the core gates.

diff --git a/core/modules/views/src/Controller/ViewAjaxController.php b/core/modules/views/src/Controller/ViewAjaxController.php
index 92cd82e..8dbdd14 100644
--- a/core/modules/views/src/Controller/ViewAjaxController.php
+++ b/core/modules/views/src/Controller/ViewAjaxController.php
@@ -164,8 +164,8 @@ public function ajaxView(Request $request) {
         // @see the redirect.destination service.
         $origin_destination = $path;
 
-        // Remove some special parameters you never want to have part of
-        // the destination query.
+        // Remove some special parameters you never want to have part of the
+        // destination query.
         $used_query_parameters = $request->query->all();
         // @todo Remove this parsing once these are removed from the request in
         //   https://www.drupal.org/node/2504709.

Minor comment fix on commit.

  • alexpott committed 3e9a50d on 8.1.x
    Issue #2637720 by dawehner, tim.plunkett: Ajax exposed filters +...

  • alexpott committed 3049685 on
    Issue #2637720 by dawehner, tim.plunkett: Ajax exposed filters +...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.