RE: Liferay forms seem to work wrong when they are localized

Javier Lamadrid, modified 6 Years ago. New Member Posts: 15 Join Date: 4/8/19 Recent Posts
Hi,


When a localized form is sent, in any other language than the default one, a validation error "Error: No value is defined for field X" is displayed. Is this a bug or is there some kind of configuration that we have not taken into account?.

Steps to reproduce it:
  1. Have at least 2 languages configured as available in the instance.
  2. Create a form with a required field and translations for those languages.
  3. Add the form to a page.
  4. Send the form in both languages, for example, changing the url http://localhost:8080/en, http://localhost:8080/es...
In the default language it is sent correctly. In the other gives the validation error described above.

The error is similar to the one defined in this issue https://issues.liferay.com/browse/LPS-88020. The differences are that it is not necessary to change the default language to reproduce it and the version of Liferay. The one we use is 7.1.2 GA3.


Thanks in advance for your help. Regards.
thumbnail
Samuel Kong, modified 6 Years ago. Liferay Legend Posts: 1902 Join Date: 3/10/08 Recent Posts
Unfortunately, this does seem like a bug. Keep watching the bug ticket and hopefully this will be fixed soon.
Amos Fong, modified 6 Years ago. New Member Posts: 15 Join Date: 4/8/19 Recent Posts
Hi Samuel,


​​​​​​​Thanks for the reply, we will be watching it! emoticon


Regards
Javier Lamadrid, modified 6 Years ago. New Member Posts: 15 Join Date: 4/8/19 Recent Posts
If it helps someone...

As a workaround we have made a fragment to override the jsp "/portal-ddm-form-web-fragment/src/main/resources/META-INF/resources/display/view.jsp". In it we have changed the:
String languageId = ddmFormDisplayContext.getDefaultLanguageId();
by:
String languageId = themeDisplay.getLanguageId();


Regards.