Commit 7fb8aab1 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Store: setVarArray(): added flagOverwrite to allow overwriting during initialisation.

parent ef2f8412
......@@ -160,7 +160,7 @@ class Store {
} catch (\Exception $e) {
throw new qfq\UserException ("Error read file " . QFQ_INI . ": " . $e->getMessage(), ERROR_READ_FILE);
}
self::setVarArray($config, STORE_SYSTEM);
self::setVarArray($config, STORE_SYSTEM,true);
}
/**
......@@ -168,9 +168,9 @@ class Store {
* @param $store
* @throws CodeException
*/
public function setVarArray(array $dataArray, $store) {
public function setVarArray(array $dataArray, $store, $flagOverwrite = false) {
if (isset(self::$raw[$store]) && count(self::$raw[$store]) > 0) {
if ($flagOverwrite && isset(self::$raw[$store]) && count(self::$raw[$store]) > 0) {
throw new CodeException("Raw values already been copied to store '$store'. Do this only one time.", ERROR_VALUE_ALREADY_CODPIED);
}
......@@ -194,7 +194,7 @@ class Store {
if (isset($GLOBALS["TSFE"]->fe_user->user["usergroup"]))
$arr[TYPO3_FE_USER_GROUP] = $GLOBALS["TSFE"]->fe_user->user["usergroup"];
self::setVarArray($arr, STORE_TYPO3);
self::setVarArray($arr, STORE_TYPO3, true);
}
/*
......@@ -215,7 +215,7 @@ class Store {
if (isset($_POST[CLIENT_SIP]))
$arr[CLIENT_POST_SIP] = $_POST[CLIENT_SIP];
self::setVarArray($arr, STORE_CLIENT);
self::setVarArray($arr, STORE_CLIENT, true);
}
/**
......@@ -235,7 +235,7 @@ class Store {
$param[SIP_URLPARAM] = self::$sip->getQueryStringFromSip($s);
// self::setVarArray(KeyValueStringParser::parse($param, "=", "&"), STORE_SIP);
self::setVarArray($param, STORE_SIP);
self::setVarArray($param, STORE_SIP, true);
}
}
......@@ -330,15 +330,17 @@ class Store {
$tmpParam = [SIP_RECORD_ID => $recordId, SIP_FORM => $formName];
// Store in SIP Store (cause it's empty until now).
self::setVarArray($tmpParam, STORE_SIP);
// Construct fake urlparam
$tmpUrlparam = OnArray::toString($tmpParam);
// Create a fake SIP which has never been passed by URL - further processing might expect this to exist.
$sip = self::getSip()->queryStringToSip($tmpUrlparam, RETURN_SIP);
self::setVar(CLIENT_SIP, $sip, STORE_CLIENT);
// Store in SIP Store (cause it's empty until now).
$tmpParam[SIP_SIP] = $sip;
self::setVarArray($tmpParam, STORE_SIP);
}
/**
......
Markdown is supported
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