Search code examples
liferayliferay-7

Liferay is generating a blank URL in the back arrow that is created when a portlet is maximized


When a portlet is maximized (p_p_state=maximized), Liferay generates a back arrow to allow navigation back to the "full page".

However, the HREF in the tag that is generated is blank. No URL. This does not happen on my local machine, but it is happening on my servers (local and servers are Liferay 7, GA7).

I have found that this is created as a tag with an HREF set to ${portlet_back_url}, which in turn is created from htmlUtil.escapeHREF(portlet_display.getURLBack()).

Which lead me to the getURLBack() method in com.liferay.portal.kernel.theme.PortletDisplay, which seems to only be a bean with a lot of properties. There is a setURLBack(), which is called from 150 files (mostly JSPs). So the value must not be getting set - but I can't find where is should be getting set from, and I don't understand why it works fine locally.

Also, the back arrow on the built-in portlets (User, Organization, Site, etc.) when working in the control panel exhibits the same behavior - so the issue is systemic (not just my custom portlet). And, as I mentioned, it's fine on my local machine that is using the same Liferay bundle - so I'm pretty sure something is different in the environment.

Has anybody come across this? Any hints on where to look?


Solution

  • You need to update yours redirect url/ip when you have deployed in server Please refer and update below properties in your portal.properties.

    Redirect

    # Set this property to "ip" or "domain" for the redirect security method. If
    # set to "domain", the portal will only redirect users to domains listed in
    # the property "redirect.url.domain.allowed". If set to "ip", the portal
    # will only redirect to domains whose IP address resolve to an IP address
    # listed in the property "redirect.url.ip.allowed".
    #
    # Env: LIFERAY_REDIRECT_PERIOD_URL_PERIOD_SECURITY_PERIOD_MODE
    #
    #redirect.url.security.mode=domain
    redirect.url.security.mode=ip
    
    #
    # Input a list of comma delimited domains which the portal is allowed to
    # redirect to. Input a blank list to allow any domain. Specifying a domain
    # with a leading "*." allows redirects to subdomains.
    #
    # Env: LIFERAY_REDIRECT_PERIOD_URL_PERIOD_DOMAINS_PERIOD_ALLOWED
    #
    redirect.url.domains.allowed=
    
    #
    # Input a list of comma delimited IPs which the portal is allowed to
    # redirect to. Input a blank list to allow any IP. SERVER_IP will be
    # replaced with the IP of the host server.
    #
    # Env: LIFERAY_REDIRECT_PERIOD_URL_PERIOD_IPS_PERIOD_ALLOWED
    #
    redirect.url.ips.allowed=127.0.0.1,SERVER_IP