Sorry, should have provided more detail. The call to my custom snippet is uncached. I assume the call to $modx->runSnippet('getPage', $params); within my custom snippet is also uncached, I couldn't find any documentation to suggest that such calls are cached.
$_POST variables are correct as when writing the $where variable to screen it returns as I expect it to.
If I change the custom snippet to output a copy of the $where variable which is dynamically built as shown in the second code block above:
return $where.'<br />'.$modx->runSnippet('getPage', $params);
it returns the correct string to pass to the $params array for: $params['where'] = $where; but outputs all rows in the table, not the ones that match the where statement.
If I hard code the values written out the where parameter is used correctly and shows only the rows from the database that match. Combinations of the $where variable that I've written out to screen then hard coded into the $params array are:
{"pers_name_last:LIKE":"U%"}
{"pro_establishment_main":"Ross Hall"}
{"quali_grade":"Consultant"}
{"pers_name_last:LIKE":"U%","pro_establishment_main":"Ross Hall"}
{"pers_name_last:LIKE":"U%","quali_grade":"Consultant"}
{"pro_establishment_main":"Ross Hall","quali_grade":"Consultant"}
{"pers_name_last:LIKE":"U%","pro_establishment_main":"Ross Hall","quali_grade":"Consultant"}
This is on Revolution 2.2.5-pl (traditional), Windows Server 2008, PHP 5.2.13 but I'm not sure that is relevant at the moment.