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

FreeMarker template error occurs when display the web content with localized Friendly URL

    Details

      Description

      Step to reproduce:

      1. Site admin > Content & Data > Web Content > Templates tab
      2. Add a template
      3. Select Basic Web Content as Structure
      4. Click the Friendly URL from Field section
      5. Publish
      6. Site admin > Site Builder > Page Templates > Display Page Templates
      7. Add a DPT with Web Content Article and Basic Web Content
      8. Add a Display Page Content fragment to DPT
      9. Publish
      10. Site admin > Content & Data > Web Content > Web Content tab
      11. Add a WC based on Basic Web Content
      12. Select new template as Default Template
      13. Select new DPT as Specific Display Page Template
      14. Type wcinenglish in Friendly URL field
      15. Select es-ES in Language Selector
      16. Type wcinspanish in Friendly URL field
      17. Publish
      18. Add a widget page
      19. Add a WCD to page
      20. Add a Language Selector to page
      21. Select new WC
      22. Assert http://localhost:8080/web/guest/w/wcinenglish is shown in WCD
      23. Select es-ES in Language Selector

      Expected Results:
      The http://localhost:8080/web/guest/w/wcinspanish should be shown in WCD

      Actual Results:
      The following freemark template error occurs

      2020-09-10 07:08:14.240 ERROR [http-nio-8080-exec-2][runtime:59] Error executing FreeMarker template
      FreeMarker template error:
      The following has evaluated to null or missing:
      ==> friendlyURLs[themeDisplay.getLanguageId()]  [in template "20098#20124#35710" at line 1, column 3]
      
      ----
      Tip: It's the final [] step that caused this error, not those before it.
      ----
      Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
      ----
      
      ----
      FTL stack trace ("~" means nesting-related):}
      

      Reproduced on:
      Tomcat 9.0.37 + MySQL 5.7. Portal master GIT ID: 21000edf85305a3f9606628c8445f8d9eae50d09.
      Tomcat 9.0.33 + MySQL 5.7. Portal 7.3.4-GA5.

        Attachments

          Activity

            People

            Assignee:
            yang.cao Yang Cao
            Reporter:
            yang.cao Yang Cao
            Participants of an Issue:
            Recent user:
            Enterprise Release HU
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              24 weeks, 2 days ago

                Packages

                Version Package
                7.3.X
                7.3.5 CE GA6
                7.3.10 DXP GA1
                Master