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

A user should not be allowed to publish a fragment with invalid freemarker, to keep consistent with invalid html

Details

    Description

      Description
      Normally the user is not allowed to publish a fragment with invalid html, 1) to prevent risks of breaking content pages and 2) because it makes no sense for them to intentionally publish a fragment with invalid html, so we help them by disallowing the publish. While we can currently check if a freemarker syntax is valid or not, we do not deny the user from publishing a fragment with invalid freemarker syntax.

      Prevention in future
      We should cover this in an integration test as well.

      Example of invalid freemarker for a fragment

      [#asign test = "test" /]
      

      Steps to Reproduce

      1. Create a fragment with invalid freemarker syntax
      2. Publish fragment

      Expected Result
      User is given a useful error telling them the freemarker syntax is invalid, possibly using liferay-ui:error taglib

      Actual Result
      User is allowed to publish the invalid fragment

      Tested on Tomcat 9.0.17 + MySQL 5.7
      Portal master GIT ID: 177cf7b77e50603caa150ad069c639c759381a0d

      Attachments

        Issue Links

          Activity

            People

              kyle.miho Kyle Miho
              kyle.miho Kyle Miho
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                3 years, 20 weeks, 1 day ago

                Packages

                  Version Package
                  Master