NullPointerException error seen with custom Terms Of Use

Issue

  • When custom content in "Terms of Use" is set via Instance Configuration in Control Panel, and logging in as a new user for the first time, a NullPointerException is seen.

Environment

  • DXP 7.4

Resolution

  • The Terms of Use code expects and requires a <section /> tag with content id to exist, and when this id is not found, it will trigger a NullPointerException error.
  • Verify that the theme has a <section /> tag with content id, such as seen in Liferay's unstyled theme:
    <section id="content">
    <h2 class="hide-accessible sr-only" role="heading" aria-level="1">${htmlUtil.escape(the_title)}</h2>

    <#if selectable>
    <@liferay_util["include"] page=content_include />
    <#else>
    ${portletDisplay.recycle()}

    ${portletDisplay.setTitle(the_title)}

    <@liferay_theme["wrap-portlet"] page="portlet.ftl">
    <@liferay_util["include"] page=content_include />
    </@>
    </#if>
    </section>
    Liferay's classic theme has a slightly different tag declaration (but otherwise the same content):
    <section class="${portal_content_css_class} flex-fill" id="content">

Additional Information

 

这篇文章有帮助吗?
0 人中有 0 人觉得有帮助