* Api: detect if framework data is missing for popups too and redirect to cd=popup to load it

This commit is contained in:
Ralf Becker 2020-10-14 17:31:17 +02:00
parent 4f1ce8da48
commit 175d94f3e3
2 changed files with 4 additions and 3 deletions

View File

@ -130,10 +130,11 @@
// ignore SecurityError exception if top is different security context / cross-origin
}
// if framework not found, but requested to check for it, redirect to cd=yes to create it
if (typeof window.framework == 'undefined' && egw_script.getAttribute('data-check-framework') &&
if (typeof window.framework == 'undefined' &&
!window.location.search.match(/[&?]cd=/))
{
window.location.search += window.location.search ? "&cd=yes" : "?cd=yes";
window.location.search += (window.location.search ? "&" : "?")+
(egw_script.getAttribute('data-check-framework') ? "cd=yes" : "cd=popup");
}
}
try {

View File

@ -1039,7 +1039,7 @@ abstract class Framework extends Framework\Extra
}
// add configuration, link-registry, images, user-data and -perferences for non-popup windows
// specifying etag in url to force reload, as we send expires header
if ($GLOBALS['egw_info']['flags']['js_link_registry'])
if ($GLOBALS['egw_info']['flags']['js_link_registry'] || isset($_GET['cd']) && $_GET['cd'] === 'popup')
{
self::includeJS('/api/config.php', array(
'etag' => md5(json_encode(Config::clientConfigs()).Link::json_registry()),