Commit 6d6a10a9 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Store.php: 'New record' problem "missing parameter due to fake SIP" fixed.

parent ef81eb0b
...@@ -568,7 +568,12 @@ class Store { ...@@ -568,7 +568,12 @@ class Store {
$recordId = 0; $recordId = 0;
} }
$tmpParam = [SIP_RECORD_ID => $recordId, SIP_FORM => $formName]; // If there are existing SIP param, keep them by copying to the new SIP Param Array
$tmpParam = self::getNonSystemSipParam();
$tmpParam[SIP_RECORD_ID] = $recordId;
$tmpParam[SIP_FORM] = $formName;
if ($recordId == 0) { if ($recordId == 0) {
// SIPs for 'new records' needs to be uniq per TAB! Therefore add a uniq parameter // SIPs for 'new records' needs to be uniq per TAB! Therefore add a uniq parameter
$tmpParam[SIP_MAKE_URLPARAM_UNIQ] = uniqid(); $tmpParam[SIP_MAKE_URLPARAM_UNIQ] = uniqid();
...@@ -588,12 +593,32 @@ class Store { ...@@ -588,12 +593,32 @@ class Store {
} }
/** /**
* Returns a pointer to this class. * Return an array with non system SIP parameter. Take the whole STORE_SIP and search for non system parameter.
* * @return array
* @return null|Sip * @throws UserFormException
* @throws \qfq\CodeException
*/ */
public static function getSipInstance() { private static function getNonSystemSipParam() {
return self::$sip; $tmpParam = array();
$sipArray = self::getStore(STORE_SIP);
foreach ($sipArray as $key => $value) {
if ($key[0] === '_') {
continue;
}
switch ($key) {
case SIP_SIP:
case SIP_RECORD_ID:
case SIP_FORM;
case SIP_URLPARAM:
continue;
default:
$tmpParam[$key] = $value;
}
}
return $tmpParam;
} }
/** /**
...@@ -619,6 +644,14 @@ class Store { ...@@ -619,6 +644,14 @@ class Store {
return array(); return array();
} }
/**
* Returns a pointer to this class.
*
* @return null|Sip
*/
public static function getSipInstance() {
return self::$sip;
}
/** /**
* Fills STORE_TABLE_DEFAULT and STORE_TABLE_COLUMN_TYPES * Fills STORE_TABLE_DEFAULT and STORE_TABLE_COLUMN_TYPES
......
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