Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
A view that uses an exposed filter on a page can be accessed from a link such as http://d.8/new?since=2014-09-10
and the value of since
will be used, filtering the view. A REST Export view with the same configuration will not be filtered by the exposed value. If there is some other mechanism that is supposed to be used to populate the filter, I can't find any documentation of it and it seems that the pattern from a page view should work with a REST view.
Repro steps:
- Install head under Apache/2.4.9 (Unix) PHP/5.5.15.
- Create two content items with different content dates.
- Create REST Export view with exposed filter greater than "Authored on" and set filter identifier.
- Make REST request to view endpoint, using filter identifier and a value in URL that should only display one node. Response will incorrectly include both nodes.
- Clone view to be a Page and use the same URL. Response will be correct.
Proposed resolution
Umm....
Remaining tasks
Identify cause & patch?
User interface changes
Existing feature will work as expected.
API changes
None?
Comments
Comment #2
khaled.zaidan CreditAttribution: khaled.zaidan at Reading Room commentedThis is duplicate of #2340623: Views REST export does not support exposed filters, but I can't re-open it.
This problem seems to be broken again (despite the display type still being set as "usesExposed").
After doing a bit of debugging, I've found that in the case of the REST export, the exposed filter is completely missing from the views filters (in the $view object), whereas it's present in other display types (e.g. page).
Looking further into it right now.
Comment #3
khaled.zaidan CreditAttribution: khaled.zaidan at Reading Room commentedWow I'm actually just a genius (read as "idiot")... editing one view while looking at another!
Please ignore this ticket :)