From 4b50f5e1db45802945ea02753acd794818ebef2a Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Fri, 3 Dec 2021 11:34:52 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B04481=20Fix=20caselog=20edition=20in=20tr?= =?UTF-8?q?ansition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/ormcaselog.class.inc.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/ormcaselog.class.inc.php b/core/ormcaselog.class.inc.php index 994f12b12..4bdab6cd8 100644 --- a/core/ormcaselog.class.inc.php +++ b/core/ormcaselog.class.inc.php @@ -506,6 +506,7 @@ class ormCaseLog { $oBlockRenderer = new BlockRenderer($oBlock); $sHtml = $oBlockRenderer->RenderHtml(); $sScript = $oBlockRenderer->RenderJsInlineRecursively($oBlock,iUIBlock::ENUM_JS_TYPE_ON_READY); + $aJsFiles = $oBlockRenderer->GetJsFiles(); if ($sScript!=''){ if ($oP == null) { $sScript = ''; @@ -514,6 +515,18 @@ class ormCaseLog { $oP->add_ready_script($sScript); } } + // Ugly hack as we use a block and strip its content above, we'll also need JS files it depends on + if(count($aJsFiles) > 0){ + foreach ($aJsFiles as $sFileAbsUrl) { + if ($oP === null) { + $sScript = ''; + $sHtml .= $sScript; + } else { + $oP->add_linked_script($sFileAbsUrl); + } + } + } + return $sHtml; }