mirror of
https://github.com/processwire/processwire.git
synced 2025-08-23 23:02:58 +02:00
Fix issue processwire/processwire-issues#671 where LiveSearch pages list could also show users if custom configured field name present on user template
This commit is contained in:
@@ -669,6 +669,7 @@ class ProcessPageSearchLive extends Wire {
|
|||||||
$user = $this->wire('user');
|
$user = $this->wire('user');
|
||||||
$superuser = $user->isSuperuser();
|
$superuser = $user->isSuperuser();
|
||||||
$pages = $this->wire('pages');
|
$pages = $this->wire('pages');
|
||||||
|
$config = $this->wire('config');
|
||||||
|
|
||||||
if(!empty($liveSearch['help'])) {
|
if(!empty($liveSearch['help'])) {
|
||||||
$result = array('title' => 'pages', 'items' => array(), 'properties' => array('name', 'title'));
|
$result = array('title' => 'pages', 'items' => array(), 'properties' => array('name', 'title'));
|
||||||
@@ -707,6 +708,7 @@ class ProcessPageSearchLive extends Wire {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if($this->useType('pages', $liveSearch['type'])) {
|
if($this->useType('pages', $liveSearch['type'])) {
|
||||||
|
$selector .= ', templates_id!=' . implode('|', $config->userTemplateIDs); // users are searched separately
|
||||||
$items['pages'] = $pages->find("$selector, status<" . Page::statusTrash);
|
$items['pages'] = $pages->find("$selector, status<" . Page::statusTrash);
|
||||||
}
|
}
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
|
Reference in New Issue
Block a user