Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
14.3.3
-
None
-
None
-
None
-
Pulsar
-
Pulsar 247 - Doc Types 1, Pulsar 249 - Doc Types 2
Description
Currently content type editor does some validations after a change in the fields and it is supposed to show error messages after a failed validation of a field. But error messages are not shown in the page as expected.
There is an easy path to reproduce the case. If the path value of a document type field is left empty, then an error message is supposed to be shown according to the FieldEditor class.
@Override public void setObject(final String path) { if (StringUtils.isBlank(path)) { final StringResourceModel errorModel = new StringResourceModel("error-path-cannot-be-blank", FieldEditor.this) .setParameters(getDescriptor().getName()); showError(errorModel.getString()); } else { try { if (path.indexOf(':') < 0) { getDescriptor().setPath(prefix + ":" + path); } else { getDescriptor().setPath(path); } } catch (final TypeException e) { showError(e.getLocalizedMessage()); } } }
private void showError(final String msg) { error(msg); final Optional<AjaxRequestTarget> target = RequestCycle.get().find(AjaxRequestTarget.class); target.ifPresent(ajaxRequestTarget -> ajaxRequestTarget.add(FieldEditor.this)); }
I investigated why it doesn't work and I figured out that all the messages stored in the feedbackMessages are somehow get cleared before the ajax response message is returned.