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

B6276: Default pattern/required/match messages have never been displayed....

B6276: Default pattern/required/match messages have never been displayed. *Clear* default in qfq extension config: Form-Config > formDataPatternError| formDataRequiredError| formDataMatchError
parent ff53b1d6
......@@ -112,13 +112,13 @@ editFormPage = form
# cat=form-config/config; type=string; label=Form data pattern error message:Default is 'pattern error'. Customizable error message used in validator.js. 'pattern' violation.
formDataPatternError = pattern error
formDataPatternError =
# cat=form-config/config; type=string; label=Form data required error message:Default is 'required error'. Customizable error message used in validator.js. 'required' violation.
formDataRequiredError = required error
formDataRequiredError =
# cat=form-config/config; type=string; label=Form data match error message:Default is 'match error'. Customizable error message used in validator.js. 'match' violation. Typically used to ensure that two given emails or passwords are identically.
formDataMatchError = match error
formDataMatchError =
# cat=form-config/config; type=string; label=Form data error message:Default is 'error'. Customizable error message used in validator.js. generic violation.
formDataError = error
......
......@@ -948,7 +948,7 @@ abstract class AbstractBuildForm {
if ($formElement[FE_TYPE] != FE_TYPE_SELECT && $formElement[FE_TYPE] != FE_TYPE_UPLOAD && $formElement[FE_TYPE] != FE_TYPE_CHECKBOX) {
$json[API_ELEMENT_UPDATE][$formElement[FE_HTML_ID]][API_ELEMENT_ATTRIBUTE]['value'] = $value;
$json[API_ELEMENT_UPDATE][$formElement[FE_HTML_ID]][API_ELEMENT_ATTRIBUTE]['required'] = $formElement[FE_MODE] == 'required';
$json[API_ELEMENT_UPDATE][$formElement[FE_HTML_ID]][API_ELEMENT_ATTRIBUTE]['hidden'] = $formElement[FE_MODE] == 'hidden';
$json[API_ELEMENT_UPDATE][$formElement[FE_HTML_ID]][API_ELEMENT_ATTRIBUTE]['hidden'] = $formElement[FE_MODE] == 'hidden';
}
}
......@@ -1211,8 +1211,15 @@ abstract class AbstractBuildForm {
$pattern = Sanitize::getInputCheckPattern($formElement[FE_CHECK_TYPE], $formElement[FE_CHECK_PATTERN], $formElement[FE_DECIMAL_FORMAT], $sanitizeMessage);
$attribute .= ($pattern === '') ? '' : 'pattern="' . $pattern . '" ';
if (empty($formElement[F_FE_DATA_PATTERN_ERROR])) {
$formElement[F_FE_DATA_PATTERN_ERROR] = $sanitizeMessage;
};
$formElement[F_FE_DATA_PATTERN_ERROR] = empty($sanitizeMessage) ? F_FE_DATA_PATTERN_ERROR_DEFAULT : $sanitizeMessage;
}
if (empty($formElement[F_FE_DATA_REQUIRED_ERROR])) {
$formElement[F_FE_DATA_REQUIRED_ERROR] = F_FE_DATA_REQUIRED_ERROR_DEFAULT;
}
if (empty($formElement[F_FE_DATA_MATCH_ERROR])) {
$formElement[F_FE_DATA_REQUIRED_ERROR] = F_FE_DATA_MATCH_ERROR_DEFAULT;
}
$attribute .= $this->getAttributeList($formElement, [F_FE_DATA_PATTERN_ERROR, F_FE_DATA_REQUIRED_ERROR, F_FE_DATA_MATCH_ERROR, F_FE_DATA_ERROR, FE_MIN, FE_MAX, FE_STEP]);
$attribute .= Support::doAttribute('data-load', ($formElement[FE_DYNAMIC_UPDATE] === 'yes') ? 'data-load' : '');
$attribute .= Support::doAttribute('title', $formElement[FE_TOOLTIP]);
......@@ -1233,7 +1240,7 @@ abstract class AbstractBuildForm {
}
}
$input .= $this->getHelpBlock() . $elementCharacterCount;
$input .= $this->getHelpBlock() . $elementCharacterCount;
if (isset($formElement[FE_INPUT_EXTRA_BUTTON_INFO])) {
$input .= $formElement[FE_INPUT_EXTRA_BUTTON_INFO];
......@@ -2016,7 +2023,7 @@ abstract class AbstractBuildForm {
if ($mode === FORM_LOAD) {
$this->store->setVar($formElement[FE_NAME], $value, STORE_SIP, false);
}
return;
}
......@@ -2755,8 +2762,8 @@ abstract class AbstractBuildForm {
$cell = $link->renderLink($columnValue);
}
if(strcasecmp($columnName, 'id')==0){
$cell = Support::wrapTag('<span class="'. $cssClassColumnId .'">', $cell,true);
if (strcasecmp($columnName, 'id') == 0) {
$cell = Support::wrapTag('<span class="' . $cssClassColumnId . '">', $cell, true);
}
return $cell;
}
......
......@@ -822,6 +822,10 @@ const F_FE_DATA_REQUIRED_ERROR = 'data-required-error';
const F_FE_DATA_MATCH_ERROR = 'data-match-error'; // contains id of the sibling input to check that i
const F_FE_DATA_ERROR = 'data-error';
const F_FE_DATA_PATTERN_ERROR_DEFAULT = 'pattern error'; // Attention: the default is also defined in ext_conf_template.txt
const F_FE_DATA_REQUIRED_ERROR_DEFAULT = 'required error'; // Attention: the default is also defined in ext_conf_template.txt
const F_FE_DATA_MATCH_ERROR_DEFAULT = 'match error'; // Attention: the default is also defined in ext_conf_template.txt
const F_PARAMETER = 'parameter'; // valid for F_ and FE_
// Form columns: via parameter field
......
......@@ -36,7 +36,7 @@ class Sanitize {
SANITIZE_ALLOW_ALNUMX => 'Allowed characters: 0...9, [latin character], @-_.m;: /()',
SANITIZE_ALLOW_DIGIT => 'Allowed characters: 0...9',
SANITIZE_ALLOW_NUMERICAL => 'Allowed characters: 0...9 and .+-',
SANITIZE_ALLOW_EMAIL => 'Requested format: string@domain',
SANITIZE_ALLOW_EMAIL => 'Requested format: string@domain.tld',
SANITIZE_ALLOW_PATTERN => 'Please match the requested format',
SANITIZE_ALLOW_ALLBUT => 'Forbidden characters: ^[]{}%&\#',
SANITIZE_ALLOW_ALL => '',
......
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