From 175d94f3e359692016bf53aa93581b0f3cd2ada4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 14 Oct 2020 17:31:17 +0200 Subject: [PATCH] * Api: detect if framework data is missing for popups too and redirect to cd=popup to load it --- api/js/jsapi/egw.js | 5 +++-- api/src/Framework.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/js/jsapi/egw.js b/api/js/jsapi/egw.js index fdcd2440b0..f88366963c 100644 --- a/api/js/jsapi/egw.js +++ b/api/js/jsapi/egw.js @@ -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 { diff --git a/api/src/Framework.php b/api/src/Framework.php index 61ef450d4a..63d36f110b 100644 --- a/api/src/Framework.php +++ b/api/src/Framework.php @@ -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()),