From 7a89f4f18885c4c18b6a974498774ac0f45493f2 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Wed, 12 Sep 2018 12:57:11 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#671 where LiveSearch pages list could also show users if custom configured field name present on user template --- .../modules/Process/ProcessPageSearch/ProcessPageSearchLive.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wire/modules/Process/ProcessPageSearch/ProcessPageSearchLive.php b/wire/modules/Process/ProcessPageSearch/ProcessPageSearchLive.php index ceac0db6..1b70dda3 100644 --- a/wire/modules/Process/ProcessPageSearch/ProcessPageSearchLive.php +++ b/wire/modules/Process/ProcessPageSearch/ProcessPageSearchLive.php @@ -669,6 +669,7 @@ class ProcessPageSearchLive extends Wire { $user = $this->wire('user'); $superuser = $user->isSuperuser(); $pages = $this->wire('pages'); + $config = $this->wire('config'); if(!empty($liveSearch['help'])) { $result = array('title' => 'pages', 'items' => array(), 'properties' => array('name', 'title')); @@ -707,6 +708,7 @@ class ProcessPageSearchLive extends Wire { try { if($this->useType('pages', $liveSearch['type'])) { + $selector .= ', templates_id!=' . implode('|', $config->userTemplateIDs); // users are searched separately $items['pages'] = $pages->find("$selector, status<" . Page::statusTrash); } } catch(\Exception $e) {