From 1f7d039b3edf47e0a0f15ecec52ab1454d663148 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Mon, 23 Dec 2024 11:35:34 -0500 Subject: [PATCH] Fix issue processwire/processwire-issues#1927 --- .../Process/ProcessPageList/ProcessPageList.module | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wire/modules/Process/ProcessPageList/ProcessPageList.module b/wire/modules/Process/ProcessPageList/ProcessPageList.module index 74d74af1..7a9d0d58 100644 --- a/wire/modules/Process/ProcessPageList/ProcessPageList.module +++ b/wire/modules/Process/ProcessPageList/ProcessPageList.module @@ -562,11 +562,14 @@ class ProcessPageList extends Process implements ConfigurableModule { if(is_array($this->hidePages)) { $nots = is_array($this->hidePagesNot) ? $this->hidePagesNot : array(); $c = array(); - if(in_array('advanced', $nots) && $config->advanced) $c[] = 'advanced'; - if(in_array('debug', $nots) && $config->debug) $c[] = 'debug'; - if(in_array('superuser', $nots) && $this->wire()->user->isSuperuser()) $c[] = 'superuser'; + if(count($nots)) { + if(in_array('advanced', $nots) && $config->advanced) $c[] = 'advanced'; + if(in_array('debug', $nots) && $config->debug) $c[] = 'debug'; + if(in_array('superuser', $nots) && $this->wire()->user->isSuperuser()) $c[] = 'superuser'; + } sort($nots); - if($c != $nots) $a = array_merge($a, $this->hidePages); + if(empty($nots) || $c != $nots) $a = array_merge($a, $this->hidePages); + $a = array_unique($a); } foreach($a as $id) $b[$id] = $id; // index by ID