1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-23 06:44:38 +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:
Ryan Cramer
2018-09-12 12:57:11 -04:00
parent 313fee873c
commit 7a89f4f188

View File

@@ -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) {