SEBSERV-122 fixed

This commit is contained in:
anhefti 2020-04-22 16:43:39 +02:00
parent 18280173c0
commit c56d3a1bd7

View file

@ -93,27 +93,29 @@ final class SebExamConfigImportPopup {
final PageContext context = formHandle.getContext();
// Ad-hoc field validation
formHandle.process(name -> true, Form.FormFieldAccessor::resetError);
final String fieldValue = form.getFieldValue(Domain.CONFIGURATION_NODE.ATTR_NAME);
if (StringUtils.isBlank(fieldValue)) {
form.setFieldError(
Domain.CONFIGURATION_NODE.ATTR_NAME,
pageService
.getI18nSupport()
.getText(new LocTextKey("sebserver.form.validation.fieldError.notNull")));
return false;
} else if (fieldValue.length() < 3 || fieldValue.length() > 255) {
form.setFieldError(
Domain.CONFIGURATION_NODE.ATTR_NAME,
pageService
.getI18nSupport()
.getText(new LocTextKey("sebserver.form.validation.fieldError.size",
null,
null,
null,
3,
255)));
return false;
if (newConfig) {
formHandle.process(name -> true, Form.FormFieldAccessor::resetError);
final String fieldValue = form.getFieldValue(Domain.CONFIGURATION_NODE.ATTR_NAME);
if (StringUtils.isBlank(fieldValue)) {
form.setFieldError(
Domain.CONFIGURATION_NODE.ATTR_NAME,
pageService
.getI18nSupport()
.getText(new LocTextKey("sebserver.form.validation.fieldError.notNull")));
return false;
} else if (fieldValue.length() < 3 || fieldValue.length() > 255) {
form.setFieldError(
Domain.CONFIGURATION_NODE.ATTR_NAME,
pageService
.getI18nSupport()
.getText(new LocTextKey("sebserver.form.validation.fieldError.size",
null,
null,
null,
3,
255)));
return false;
}
}
if (fieldControl instanceof FileUploadSelection) {