Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-67448

Web Form: Syntax Error when using simple quotes in Validation Error Message field

    Details

    • Branch Version/s:
      7.0.x, 6.2.x
    • Backported to Branch:
      Committed
    • Story Points:
      1
    • Fix Priority:
      3

      Description

      In master

      0. Build and deploy the web-form-portlet from the plugins repository
      1. Enable the validation at Configuration / System Settings / Other / web.form.service.configuration.name -> Edit
      2. Add Web Form portlet to a site
      3. In the Configuration, type into the Validation Script field the following:

      return true

      4. Put the following text to the Validation Error Message:

      you haven't filled this field

      5. Save the configuration and fill in this form
      6. Open the developer tool in your browser

      In ee-6.2.x

      0. Build and deploy the web-form-portlet from the plugins repository
      1. In your tomcat library go to webapps\web-form-portlet\WEB-INF\classes\portlet.properties file and change

      validation.script.enabled=true

      2. Add Web Form portlet to a site
      3. In the Configuration, type into the Validation Script field the following:

      return true

      4. Put the following text to the Validation Error Message:

      you haven't filled this field

      5. Save the configuration and fill in this form
      6. Open the developer tool in your browser

      Actual result:

      Uncaught SyntaxError: Unexpected identifier
      fieldValidationErrorMessages[key] = 'you haven't filled this field';

      In master, you will see the error message only in the console log.

      Expected result:

      No errors should be thrown.

      Reproduced in 6.2.x @c5d4f787e572f2f8de17b43c56634bfc468ba367
      Reproduced in master @b6a9aef74e112cdc5b4029347dffd3ff482b3423

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 42 weeks, 5 days ago