Coming here from #1904922: Views UI Preview - pager navigation is broken.
Navigation in the UI view preview is not working. This applies to: navigation through clicking links in the pager, clicking a sortable field in a column header of a table view, and clicking 'Apply' after selecting an exposed filter/sort.
Steps to reproduce:
Create 2 nodes
Create a view of nodes, limit to 1, use a pager
Preview the view in the Views UI
Click the "next" link
Expected result:
The second node
Actual result:
A second 'blank' Views UI Preview form, embedded in the Views UI Preview form.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2048309_view-preview_2.patch | 8.59 KB | mondrake |
| #2 | interdiff_1-2.txt | 5.12 KB | mondrake |
| #1 | 2048309_view-preview_1.patch | 3.46 KB | mondrake |
Comments
Comment #1
mondrakeStart...
This patch would pretty much allow for navigating in the preview. It fixes the duplicate form and allows navigating through pager links, sortable columns, and exposed filters/sorts.
Key points:
The pager is currently using current_path() to get the URL, and since here we are within the request scope, whatever is in _current_path() will not be used. I understand this is temporary so I will not touch that.
Comment #2
mondrakeHere with tests that check if pager navigation within preview is as expected.
Unfortunately, I could not make a test-only that fails in the current context. Apparently live js and emulated ajax in simpletest have different behaviour. In live js, clicking on a link will lead to a POST w/o 'triggering_element' set (just the 'js' = 'true' set in input). In simpletest AJAX, parts of form state are somehow stored in drupalSettings so that even if we do not set a triggering element when we go for a drupalPostAJAX, $form_state['show_preview'] is still available from the previous calls - so the preview is rendered based on this condition (at least that's what I could understand).
Comment #3
mondrake#2: 2048309_view-preview_2.patch queued for re-testing.
Comment #4
mondrakeDoes this deserve a major priority?
Comment #5
mondrake#2: 2048309_view-preview_2.patch queued for re-testing.
Comment #6
dawehnerI know that kind of a failing test is kind of important, but consider that the preview has a problems without it, I will RTBC it.
Comment #7
catchThis is the kind of test where Mink/Behat would be so much nicer.
Committed/pushed to 8.x, thanks!
Comment #8
mondrakefollow-up #2066207: Views UI preview does not retain Contextual filters on pagination