Details

    • Branch Version/s:
      6.0.x
    • Backported to Branch:
      Committed
    • Liferay Contributor's Agreement:
      Accept

      Description

      FTL_liferay.ftl file has an incorrect if-clause for the main css file. Also when the code is manually fixed it seems that css_main_file and js_main_file are undefined. What this means is that all popups have same background than your website and nothing else. No textboxes, buttons, nothing. This is because processing the portal_pop_up.ftl stops when these errors occur. Here's the part where these macros are called in portal_pop_up.ftl:

      <head>
      <title>$

      {the_title}

      </title>

      $

      {theme.include(top_head_include)}

      <@liferay.css file_name=css_main_file/>
      <@liferay.js file_name=js_main_file/>
      </head>

      Here's the broken code snippet from FTL_liferay.ftl:

      <#macro css file_name>
      <#assign file_id = "">

      <#if file_name = css_main_file>
      <#assign file_id = "mainLiferayThemeCSS" />
      </#if>

      <link class="lfr-css-file" href="$

      {file_name}" id="${file_id}" rel="stylesheet" type="text/css" />
      </#macro>

      <#macro js file_name>
      <#assign file_id = "" />

      <#if file_name == js_main_file>
      <#assign file_id = "mainLiferayThemeJavaScript" />
      </#if>

      <script id="${file_id}" src="${file_name}

      " type="text/javascript"></script>
      </#macro>

      As you can see the <#if file_name = css_main_file> is missing a =-mark. Even after fixing the missing =-mark, both variables still caused errors saying they were undefined. I managed to fix the undefined error by copy-pasting both functions to my init_custom.ftl, renaming them and using them from there:

      <#macro css file_name>
      <#assign file_id = "">

      <#if file_name == css_main_file>
      <#assign file_id = "mainLiferayThemeCSS" />
      </#if>

      <link class="lfr-css-file" href="$

      {file_name}" id="${file_id}" rel="stylesheet" type="text/css" />
      </#macro>

      <#macro js file_name>
      <#assign file_id = "" />

      <#if file_name == js_main_file>
      <#assign file_id = "mainLiferayThemeJavaScript" />
      </#if>

      <script id="${file_id}" src="${file_name}

      " type="text/javascript"></script>
      </#macro>

      Errors are:
      19:45:07,296 ERROR [runtime:96] Expression css_main_file is undefined on line 6, column 26 in FTL_liferay.ftl.
      20:01:43,588 ERROR [runtime:96] Expression js_main_file is undefined on line 16, column 27 in FTL_liferay.ftl.

      I've attached a stacktrace from both errors. I don't know why those variables are undefined, but maybe you'll find it as I don't know the whole process of Liferay Freemarker processing.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 27 weeks, 6 days ago