pdoResources and WHERE filter
If I use a WHERE filter the results include deleted and unpublished resources.
I even tried adding to the WHERE (AND:published:=":1} but this made no difference
I'm running this as a snippet
I even tried adding to the WHERE (AND:published:=":1} but this made no difference
I'm running this as a snippet
$output = "<ul>";
$output .= $modx->runSnippet('pdoPage',array(
'element' => 'getResources',
'parents' => $categoryFilter,
'tpl' => 'rcList-default',
'pageLimit' => '7',
'includeTVs' => '1',
'processTVs' => '1',
'toPlaceholder' => 'rcListing',
'where' => $searchFilter,
'tvFilters' => $tvFilter
));
$output .= "</ul>"; Комментарии: 7
Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
Below is the actual code
I'm now using getResources because I can't allow deleted or unpublished resources to show. But I'd really like to use pdoResources because it is much faster!
Try to debug you call using &showLog=`1`. For example:
Will output:
As you see — there is exists published and deleted conditions by default.
I have a mistake in WHERE filter, Than I checked all mistakes and the snippet worked great) Try it.
The snippet works but when the WHERE filter is used it return unpublished and deleted resources.
If I change pdoResources to getResources it works fine.
So I don't think the problem is in my WHERE filter. I think the problem is that pdoResources forgets to look at the published field when it's processing a WHERE filter