Due to the moving around of a lot of code, something happened and a submit handler got lost.
Additional some form['#actions'] exist two times.

Comments

dawehner’s picture

StatusFileSize
new1.96 KB

     $args = array();
-    if (!empty($form_state['values']['view_args'])) {
-      $args = explode('/', $form_state['values']['view_args']);
+    if (!empty($form_state['input']['view_args'])) {
+      $args = explode('/', $form_state['input']['view_args']);
     }

This is the only change i'm not sure why it's needed, even $form_state['values'] is filled on the rebuild request,
it doesn't work as expect, so we maybe need investigation.

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new2.64 KB

Finally figured it out.

  • You just want to render the view once the submit function got runned
  • Therefore set the renderPreview property so the view only gets the $form_state['values']['view_args'] once
damiankloip’s picture

StatusFileSize
new5.25 KB
new3.29 KB

Here are some quick tests to show this failing and passing with the Daniel's fix.

dawehner’s picture

+++ b/core/modules/views/lib/Drupal/views/Tests/UI/PreviewTest.phpundefined
@@ -0,0 +1,52 @@
+   * Tests the settings for the edit ui.

we never c&p in tests, we never do :)

+++ b/core/modules/views/lib/Drupal/views/Tests/UI/PreviewTest.phpundefined
@@ -0,0 +1,52 @@
+    $this->drupalLogin($this->adminUser);

No need for that, the UITestBase does this for us.

damiankloip’s picture

StatusFileSize
new5.93 KB

The tests and the correct patch containing the fix...

damiankloip’s picture

StatusFileSize
new5.88 KB

And with the comments from #4! :)

damiankloip’s picture

StatusFileSize
new5.85 KB

We don't need the $edit_url variable now either. Sorry for the issue noise.

tim.plunkett’s picture

Title: views ui preview form cleanup removed a submit handler so arguments don't work in preview. » Contextual filters are broken in the Views UI preview
Component: views.module » views_ui.module
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new5.85 KB
new3.2 KB
new2.27 KB

I've cleaned up the docs and coding style, but this indeed was a bug of my creation :(

The tests look good, just double checking.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Looks good, comes with nice test coverage. Committed/pushed to 8.x.

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