Commit d229bf35 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'B8098FeRetypeLabelDontRespectLanguage' into 'master'

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

See merge request !159
parents 1e64e71b 0daf73d8
Pipeline #2012 passed with stages
in 2 minutes and 39 seconds
......@@ -669,9 +669,6 @@ abstract class AbstractBuildForm {
$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 = '';
Support::setIfNotSet($formElement, FE_VALUE);
......@@ -687,6 +684,10 @@ abstract class AbstractBuildForm {
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
}
// 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
$sanitizeClass = ($mode == FORM_UPDATE) ? SANITIZE_ALLOW_ALL : $formElement[FE_CHECK_TYPE];
$value = $this->store->getVar($name, $storeUse, $sanitizeClass, $foundInStore);
......
......@@ -86,6 +86,17 @@ class HelperFormElement {
}
}
$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
}
}
......
......@@ -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 \UserFormException
......@@ -454,7 +454,7 @@ class QuickFormQuery {
// Check if the defined column primary key exist.
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']) {
......
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