From 4fe35d9e3ce378f4e205c7ffda60ffbaa1e636c2 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sat, 4 Oct 2025 16:24:13 +0200 Subject: [PATCH] PageTemplate/Fixup * fix merging jsGlobals from comments/etc. into existing PageTemplate --- includes/components/response/templateresponse.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/components/response/templateresponse.class.php b/includes/components/response/templateresponse.class.php index 9d3b2ec7..bc5ff8f6 100644 --- a/includes/components/response/templateresponse.class.php +++ b/includes/components/response/templateresponse.class.php @@ -625,7 +625,14 @@ class TemplateResponse extends BaseResponse // as this may be loaded from cache, it will be unlinked from its response if ($ptJSG = $this->result->jsGlobals) { - Util::mergeJsGlobals($ptJSG, $this->jsGlobals); + foreach ($this->jsGlobals as $type => [, $data, ]) + { + if (!isset($ptJSG[$type]) || $type == Type::USER) + $ptJSGs[$type] = $this->jsGlobals[$type]; + else + Util::mergeJsGlobals($ptJSG[$type][1], $data); + } + $this->result->jsGlobals = $ptJSG; } else if ($this->jsGlobals)