Commit 0daf73d8 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Fixes #8098 - Language specific retype label or note has not been set correctly.

parent 1e64e71b
...@@ -669,9 +669,6 @@ abstract class AbstractBuildForm { ...@@ -669,9 +669,6 @@ abstract class AbstractBuildForm {
$this->fillWrapLabelInputNote($formElement[FE_BS_LABEL_COLUMNS], $formElement[FE_BS_INPUT_COLUMNS], $formElement[FE_BS_NOTE_COLUMNS]); $this->fillWrapLabelInputNote($formElement[FE_BS_LABEL_COLUMNS], $formElement[FE_BS_INPUT_COLUMNS], $formElement[FE_BS_NOTE_COLUMNS]);
} }
//In case the current element is a 'RETYPE' element: take the element name of the source FormElement. Needed in the next row to retrieve the default value.
$name = (isset($formElement[FE_RETYPE_SOURCE_NAME])) ? $formElement[FE_RETYPE_SOURCE_NAME] : $formElement[FE_NAME];
$value = ''; $value = '';
Support::setIfNotSet($formElement, FE_VALUE); Support::setIfNotSet($formElement, FE_VALUE);
...@@ -687,6 +684,10 @@ abstract class AbstractBuildForm { ...@@ -687,6 +684,10 @@ abstract class AbstractBuildForm {
if ($storeUse == STORE_USE_DEFAULT && $this->store->getVar($formElement[FE_NAME], STORE_TABLE_COLUMN_TYPES) === false) { if ($storeUse == STORE_USE_DEFAULT && $this->store->getVar($formElement[FE_NAME], STORE_TABLE_COLUMN_TYPES) === false) {
$storeUse = str_replace(STORE_TABLE_DEFAULT, '', $storeUse); // Remove STORE_DEFAULT $storeUse = str_replace(STORE_TABLE_DEFAULT, '', $storeUse); // Remove STORE_DEFAULT
} }
// In case the current element is a 'RETYPE' element: take the element name of the source FormElement. Needed to retrieve the default value later.
$name = (isset($formElement[FE_RETYPE_SOURCE_NAME])) ? $formElement[FE_RETYPE_SOURCE_NAME] : $formElement[FE_NAME];
// Retrieve value via FSRVD // Retrieve value via FSRVD
$sanitizeClass = ($mode == FORM_UPDATE) ? SANITIZE_ALLOW_ALL : $formElement[FE_CHECK_TYPE]; $sanitizeClass = ($mode == FORM_UPDATE) ? SANITIZE_ALLOW_ALL : $formElement[FE_CHECK_TYPE];
$value = $this->store->getVar($name, $storeUse, $sanitizeClass, $foundInStore); $value = $this->store->getVar($name, $storeUse, $sanitizeClass, $foundInStore);
......
...@@ -86,6 +86,17 @@ class HelperFormElement { ...@@ -86,6 +86,17 @@ class HelperFormElement {
} }
} }
$element = array_merge($element, $arr); $element = array_merge($element, $arr);
// For retype elements: copy the language specific value.
if (isset($element[FE_RETYPE_SOURCE_NAME])) {
if (!empty($element[FE_RETYPE_LABEL])) {
$element[FE_LABEL] = $element[FE_RETYPE_LABEL];
}
if (!empty($element[FE_RETYPE_NOTE])) {
$element[FE_NOTE] = $element[FE_RETYPE_NOTE];
}
}
$element[$keyName] = ''; // to not expand it a second time $element[$keyName] = ''; // to not expand it a second time
} }
} }
......
...@@ -265,7 +265,7 @@ class QuickFormQuery { ...@@ -265,7 +265,7 @@ class QuickFormQuery {
} }
/** /**
* Determine the name of the language parameter field, which has to be taken to fill language specific defintions. * Determine the name of the language parameter field, which has to be taken to fill language specific definitions.
* *
* @throws \CodeException * @throws \CodeException
* @throws \UserFormException * @throws \UserFormException
...@@ -454,7 +454,7 @@ class QuickFormQuery { ...@@ -454,7 +454,7 @@ class QuickFormQuery {
// Check if the defined column primary key exist. // Check if the defined column primary key exist.
if ($this->store::getVar($this->formSpec[F_PRIMARY_KEY], STORE_TABLE_COLUMN_TYPES) === false) { if ($this->store::getVar($this->formSpec[F_PRIMARY_KEY], STORE_TABLE_COLUMN_TYPES) === false) {
throw new UserFormException("Primary Key '" . $this->formSpec[F_PRIMARY_KEY] . "' not found in table " . $this->formSpec[F_TABLE_NAME], ERROR_INVALID_OR_MISSING_PARAMETER); throw new \UserFormException("Primary Key '" . $this->formSpec[F_PRIMARY_KEY] . "' not found in table " . $this->formSpec[F_TABLE_NAME], ERROR_INVALID_OR_MISSING_PARAMETER);
} }
switch ($this->formSpec['render']) { switch ($this->formSpec['render']) {
......
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