diff --git a/core/src/Revolution/Processors/Workspace/Lexicon/GetList.php b/core/src/Revolution/Processors/Workspace/Lexicon/GetList.php
index ceca4fadd26..a853ce0c930 100644
--- a/core/src/Revolution/Processors/Workspace/Lexicon/GetList.php
+++ b/core/src/Revolution/Processors/Workspace/Lexicon/GetList.php
@@ -14,6 +14,7 @@
use MODX\Revolution\Formatter\modManagerDateFormatter;
use MODX\Revolution\modLexiconEntry;
use MODX\Revolution\Processors\Processor;
+use xPDO\xPDO;
/**
* Gets a list of lexicon entries
@@ -110,23 +111,24 @@ public function process()
);
$entries = is_array($entries) ? $entries : [];
+ /*
+ * Core namespace and empty: clear lexicon cache so loadCache() elsewhere gets fresh data,
+ * then retry getFileTopic once in case result depended on cache/path state (#15465).
+ */
+ if ($this->getProperty('namespace') === 'core' && empty($entries)) {
+ $this->modx->lexicon->clearCache();
+ $this->modx->log(xPDO::LOG_LEVEL_DEBUG, 'Lexicon GetList: core topic empty, cleared cache and retried');
+ $entries = $this->modx->lexicon->getFileTopic(
+ $this->getProperty('language'),
+ $this->getProperty('namespace'),
+ $this->getProperty('topic')
+ );
+ $entries = is_array($entries) ? $entries : [];
+ }
+
/* if searching */
if (!empty($query)) {
- function parseArray($needle, array $haystack = [])
- {
- if (!is_array($haystack)) {
- return false;
- }
- $results = [];
- foreach ($haystack as $key => $value) {
- if (strpos($key, $needle) !== false || strpos($value, $needle) !== false) {
- $results[$key] = $value;
- }
- }
- return $results;
- }
-
- $entries = parseArray($query, $entries);
+ $entries = $this->filterEntriesByQuery($query, $entries);
}
/* add in unique entries */
@@ -172,4 +174,24 @@ function parseArray($needle, array $haystack = [])
return $this->outputArray($list, $count);
}
+
+ /**
+ * Filter lexicon entries by search query (key or value contains needle).
+ *
+ * @param string $query Search string.
+ * @param array $entries Name => value entries.
+ * @return array Filtered entries.
+ */
+ private function filterEntriesByQuery(string $query, array $entries): array
+ {
+ $results = [];
+ foreach ($entries as $key => $value) {
+ $keyMatch = strpos((string) $key, $query) !== false;
+ $valueMatch = is_string($value) && strpos($value, $query) !== false;
+ if ($keyMatch || $valueMatch) {
+ $results[$key] = $value;
+ }
+ }
+ return $results;
+ }
}
diff --git a/manager/templates/default/browser/index.tpl b/manager/templates/default/browser/index.tpl
index 88c835e402f..7c67f031d66 100644
--- a/manager/templates/default/browser/index.tpl
+++ b/manager/templates/default/browser/index.tpl
@@ -5,19 +5,19 @@
-
-
+
+
{if isset($_config.ext_debug) && $_config.ext_debug}
-
-
+
+
{else}
-
-
+
+
{/if}
-
-
-
+
+
+
{$maincssjs}
diff --git a/manager/templates/default/header.tpl b/manager/templates/default/header.tpl
index 5f96797a981..bd9aa77d610 100644
--- a/manager/templates/default/header.tpl
+++ b/manager/templates/default/header.tpl
@@ -8,20 +8,20 @@
{if $_config.manager_favicon_url}{/if}
-
+
{if isset($_config.ext_debug) && $_config.ext_debug}
-
-
+
+
{else}
-
-
+
+
{/if}
-
-
-
+
+
+
+