When using AJAX to filter\update view results, all records for the Custom Post Type are being returned regardless of permissions or filtering.
If I stop using AJAX and use a full page reload for results then things work as expected (AJAX is required however!)
Regardless of security (Access plugin), a guest disabled from accessing posts for a given CPT can return a list of all posts by simply clicking the search button. Here is an example:
'Locations' are a CPT with permissions defined by access to restrict guest access. I have 1 'Select' field that is filtering based on status. Clicking the link below shows no results but clicking 'Search' shows all 4 records even though you do not have permission (defined through Access) and the results are not updated based on the filter:
hidden link
This URL above allows testing of both the security and select field issue - guest user should not have access to these records, and even if they did the Select filter should restrict access to some records. In all cases all records are returned.
I initially believed it may be a WPEngine Caching issue (my host) and discussed it thoroughly with them. It does not appear to be because:
- Issue exists on Live Site
- Issue exists on Staging site (no caching)
- Issue exists when logged in (no caching)
- Issue exists with pages excluded from caching
- AJAX calls bypass their caching
- They say AJAX should work with no issues
- Issue is resolved if I remove AJAX
- have tried manually purging all caches with WPEngine
I previously logged this issue here:
https://toolset.com/forums/topic/parametric-search-not-working-for-select-fields-other-fields-working-ok/
This patch did not help:
https://toolset.com/errata/views-ajax-pagination-fails-form-results-rendered-separatedly/
Also tried:
- disabling all other plugins (only Advanced Custom Fields other than Toolset plugins)
- tried with just Types\Views plugins enabled
- I am using Toolset Starter Child Theme
- same problem with any theme including 2016
- searched extensively through support forum including other WPEngine posts. I can see some people have issue with 'Select' fields, but cannot see an issue where all results are being shown as well. The recommendations from their posts did not resolve my issue.
- removed anything custom from functions.php
- fully deleted Toolset plugins and downloaded latest versions from website
- tried in an 'Archive page' with a view:
hidden link
- tried in a page with a view:
hidden link
In all scenarios the same issue exists when using AJAX.
Any help really appreciated,
Thanks, Tristian