[TECHNICAL REQUEST] LPS-50578 Changing language is impossible on pages like terms_of_use

Hi Ray,

We have a customer issue that on the "Terms of use" page, customer can not change language with the language portlet embedded in the theme. Actually, it's true at some other types of redirection to simple struts action type requests also, like the password reminder, password reset, etc.

The root cause is that if a user has not accepted the terms of use, PortalRequestProcessor.processPath method returns with _PATH_PORTAL_TERMS_OF_USE so the language portlet's ViewActon.processAction method will not be called.

I found out, that if request method is POST, we should not check that user was accepted the terms of use or not, it is enough to check it when the request method is GET, because after the POST we will redirect the browser, so it will come a GET and the terms_of_use page will be rendered. In this way, during the POST request, the language portlet's processAction method can run.

Zsigmond Rab and I were talking about this fix. First we were a bit scared, if we introduced some security risks and customers can somehow skip the Terms of use (and the other similar) pages, but we did not find anything suspicious.

I would like to ask you to check it, if it is an acceptable fix or not. We are opened to other fixing-ideas also.

The LPS for this pull request is: https://issues.liferay.com/browse/LPS-50578

Thank you in advance
Péter Borkuti