Issue
- Fields marked as required and left empty when trying to submit a form or publish a folder display a different error message than what is expected: “This field is required”.
Environment
- DXP 7.4 U49+
Resolution
- Before the release of DXP 7.4 U49, the default error message would only be "This field is required." if you did not set a custom message. However, after this update, even if you do not set a custom error message, it will display the message as this: "This [FIELD NAME] field is required."
- This behavior was flagged as intended and was introduced by LPS-166091.
- It was stated that the error message displayed in previous versions of DXP that came before U49 was not the right one, instead what should have been displayed was always: "This [FIELD NAME] field is required."
- If you wish to change this behavior, the only way to do that is to customize the taglibs. The associated links can be found at the Additional Information section below.
Additional Information
-
If you're marking the input as required then you will need to customize this class - https://github.com/liferay/liferay-portal/blob/master/util-taglib/src/com/liferay/taglib/aui/InputTag.java.
- If you are including a validator tag that is required and not specifying an errorMessage then you will need to customize this class - https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/taglib/aui/form/end.jsp#L51-L53.
Contenido exclusivo para suscriptores.
Una Suscripción Enterprise de Liferay proporciona acceso a más de 1.500 artículos que incluyen las mejores practicas, diagnóstico de problemas y otras soluciones útiles. Inicia sesión para tener un acceso completo.
Inicia sesión