Commit ed32038d authored by enured's avatar enured
Browse files

S13562. Set default baseUrl. Customized baseUrl Exception. Changed Exception...

S13562. Set default baseUrl. Customized baseUrl Exception. Changed Exception String for qfq config file.
parent b386f1a6
Pipeline #6638 passed with stages
in 3 minutes and 15 seconds
......@@ -213,6 +213,18 @@ class DatabaseUpdate {
private function checkT3QfqConfig($old, $new) {
if ($new == $old || $old===false ) {
// Set baseUrl default
if($GLOBALS["_SERVER"]["SCRIPT_URI"] !== ''){
if($GLOBALS["TYPO3_CONF_VARS"]["EXTENSIONS"]["qfq"]["baseUrl"] === ''){
$fullUrl = parse_url($GLOBALS["_SERVER"]["SCRIPT_URI"]);
$fullUrl['sections'] = explode('/', $fullUrl['path']);
$baseUrl = $fullUrl['scheme'].'://'.$fullUrl['host'];
for($i = 1; $i < sizeof($fullUrl['sections']) -1; $i++){
$baseUrl .= '/'.$fullUrl['sections'][$i];
}
T3Handler::updateT3QfqConfig(SYSTEM_BASE_URL, $baseUrl); //Legacy behaviour.
}
}
return;
}
......
......@@ -220,7 +220,11 @@ class Path {
// ensure base url is configured
if (is_null(self::$urlApp) || self::$urlApp === '') {
Thrower::userFormException('Base url not configured.', 'Go to QFQ extension configuration in the Typo3 backend and fill in a value for config.baseUrl');
if($GLOBALS["_SERVER"]["SCRIPT_URI"] ==='') {
Thrower::userFormException('Base url not configured.', 'Go to QFQ extension configuration in the Typo3 backend and fill in a value for config.baseUrl');
}else{
Thrower::userFormException('Base url has now been configured.', 'Please refresh page');
}
}
return self::join(self::$urlApp, $pathPartsToAppend);
}
......
......@@ -80,7 +80,7 @@ class Config {
if (!file_exists($absoluteConfigFilePath)) {
HelperFile::createPathRecursive(Path::absoluteConf());
HelperFile::file_put_contents(Path::absoluteConf(CONFIG_QFQ_JSON_EXAMPLE), json_encode(self::CONFIG_REQUIRED_TEMPLATE, JSON_PRETTY_PRINT));
Thrower::userFormException("Please create qfq config file '" . CONFIG_QFQ_JSON . "' in the conf directory which is inside the project directory. Example config file '" . CONFIG_QFQ_JSON_EXAMPLE . "' was created in conf directory.", "Project directory: " . Path::absoluteProject());
Thrower::userFormException("Please create qfq config file '" . CONFIG_QFQ_JSON . "' in path fileadmin/protected/qfqProject/conf/ which is inside the project directory. Example config file '" . CONFIG_QFQ_JSON_EXAMPLE . "' was created in conf directory.", "Project directory: " . Path::absoluteProject());
}
$config = HelperFile::json_decode(HelperFile::file_get_contents($absoluteConfigFilePath));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment