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

Fixed uninitialised variable.

parent cbe35309
Pipeline #1162 passed with stage
in 1 minute and 43 seconds
......@@ -975,7 +975,7 @@ abstract class AbstractBuildForm {
$statusHidden = ($formElement[FE_MODE] == 'hidden');
$pattern = null;
if ( isset($formElement[FE_CHECK_PATTERN]) && $formElement[FE_CHECK_PATTERN] != '') {
if (isset($formElement[FE_CHECK_PATTERN]) && $formElement[FE_CHECK_PATTERN] != '') {
$pattern = $statusHidden ? false : $formElement[FE_CHECK_PATTERN];
}
......@@ -1264,8 +1264,8 @@ abstract class AbstractBuildForm {
$value = '';
}
if ($formElement[FE_DECIMAL_FORMAT] !== '' ) {
if($value!=='') { // empty string causes exception in number_format()
if ($formElement[FE_DECIMAL_FORMAT] !== '') {
if ($value !== '') { // empty string causes exception in number_format()
$decimalScale = explode(',', $formElement[FE_DECIMAL_FORMAT])[1]; // scale: Nachkommastellen
$value = number_format($value, $decimalScale, '.', '');
}
......@@ -3247,6 +3247,7 @@ abstract class AbstractBuildForm {
*/
public function buildDateTime(array $formElement, $htmlFormElementName, $value, array &$json, $mode = FORM_LOAD) {
$attribute = '';
$placeholder = '';
$attribute .= Support::doAttribute('id', $formElement[FE_HTML_ID]);
$attribute .= Support::doAttribute('name', $htmlFormElementName);
......@@ -3312,8 +3313,10 @@ abstract class AbstractBuildForm {
$formElement[FE_PLACEHOLDER] = $placeholder;
}
if ($formElement[F_FE_DATA_PATTERN_ERROR] == '')
$formElement[F_FE_DATA_PATTERN_ERROR] = "Please match this format: $placeholder";
if ($formElement[F_FE_DATA_PATTERN_ERROR] == '') {
$formElement[F_FE_DATA_PATTERN_ERROR] = "Please match the format: " . $placeholder;
}
$attribute .= $this->getAttributeList($formElement, [F_FE_DATA_PATTERN_ERROR, F_FE_DATA_REQUIRED_ERROR, F_FE_DATA_MATCH_ERROR, F_FE_DATA_ERROR]);
$attribute .= $this->getAttributeList($formElement, [FE_INPUT_AUTOCOMPLETE, 'autofocus', 'placeholder']);
......
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