PageTemplate/Fixup

* fix merging jsGlobals from comments/etc. into existing PageTemplate
This commit is contained in:
Sarjuuk
2025-10-04 16:24:13 +02:00
parent 5355989015
commit 4fe35d9e3c

View File

@@ -625,7 +625,14 @@ class TemplateResponse extends BaseResponse
// as this may be loaded from cache, it will be unlinked from its response // as this may be loaded from cache, it will be unlinked from its response
if ($ptJSG = $this->result->jsGlobals) 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; $this->result->jsGlobals = $ptJSG;
} }
else if ($this->jsGlobals) else if ($this->jsGlobals)