Skip to content

Commit

Permalink
Fix namespaces getlist processor when cache_db is active (#16681)
Browse files Browse the repository at this point in the history
### What does it do?
Makes sure the code doesn't try to cache this specific query.

### Why is it needed?
When `cache_db` is active, the processor throws an error (`Code: 0
communication failure`).

### How to test
* Set the system setting `cache_db` to `Yes`
* Make sure that on the system settings page
(`manager/?a=system/settings`), the dropdown "Filter by namespace..."
displays the list of namespaces.

### Related issue(s)/PR(s)
Resolves #16674
halftrainedharry authored Jan 30, 2025
1 parent 423b9d8 commit feb9ed8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@ public function prepareQueryBeforeCount(xPDOQuery $c)
if ($foreignKeyWhere) {
$nsSubquery->where($foreignKeyWhere);
}
$namespaces = $this->modx->getObject($settingsClass, $nsSubquery)->get('namespaces');
$namespaces = $this->modx->getObject($settingsClass, $nsSubquery, false)->get('namespaces');

$c->where(
"`{$c->getAlias()}`.`name` IN (\"{$namespaces}\")"

0 comments on commit feb9ed8

Please sign in to comment.