Commit 51ea9bbb authored by Carsten  Rose's avatar Carsten Rose
Browse files

FillStoreForm.php: replace 'name' by FE_NAME

parent 318f0f30
......@@ -170,7 +170,7 @@ class FillStoreForm {
foreach ($this->feSpecNative AS $formElement) {
// Never get a predefined 'id'
if ($formElement['name'] === 'id')
if ($formElement[FE_NAME] === 'id')
continue;
// Preparation for Log, Debug
......@@ -180,18 +180,18 @@ class FillStoreForm {
$formElement = $this->evaluate->parseArray($formElement, $skip, $debugStack);
// Get related formElement. Construct the field name used in the form.
$clientFieldName = HelperFormElement::buildFormElementName($formElement['name'], $fakeRecordId);
$clientFieldName = HelperFormElement::buildFormElementName($formElement, $fakeRecordId);
// Some Defaults
$formElement = Support::setFeDefaults($formElement);
if ($formElement[FE_TYPE] === FE_TYPE_EXTRA) {
// Extra elements will be transferred by SIP
if (!isset($sipValues[$formElement['name']])) {
throw new CodeException("Missing the " . FE_TYPE_EXTRA . " field '" . $formElement['name'] . "' in SIP.", ERROR_MISSING_HIDDEN_FIELD_IN_SIP);
if (!isset($sipValues[$formElement[FE_NAME]])) {
throw new CodeException("Missing the " . FE_TYPE_EXTRA . " field '" . $formElement[FE_NAME] . "' in SIP.", ERROR_MISSING_HIDDEN_FIELD_IN_SIP);
}
$newValues[$formElement['name']] = $sipValues[$formElement['name']];
$newValues[$formElement[FE_NAME]] = $sipValues[$formElement[FE_NAME]];
continue;
}
......@@ -217,15 +217,15 @@ class FillStoreForm {
case 'datetime':
case 'time':
if ($clientValues[$clientFieldName] !== '') // do not check empty values
$newValues[$formElement['name']] = $this->doDateTime($formElement, $clientValues[$clientFieldName]);
$newValues[$formElement[FE_NAME]] = $this->doDateTime($formElement, $clientValues[$clientFieldName]);
break;
default:
// Check only if their is something
if($clientValues[$clientFieldName] !== '') {
$newValues[$formElement['name']] = Sanitize::sanitize($clientValues[$clientFieldName],
$newValues[$formElement[FE_NAME]] = Sanitize::sanitize($clientValues[$clientFieldName],
$formElement['checkType'], $formElement['checkPattern'], SANATIZE_EXCEPTION);
} else {
$newValues[$formElement['name']] ='';
$newValues[$formElement[FE_NAME]] = '';
}
break;
}
......
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