Bug: Mobile V1 users not prompted to log in when they click "Reply" on a post (Fix included)
I reported this bug to Lithium, which is present in Mobile V1. It occurs when a user has been authenticated, but has not registered/chosen a username yet. We have it set up like this because our forums are not public, you must be a user on our main website, and then you can view the forum. Once a user takes an action, such as clicks "Reply" to a post, then it should prompt the user to choose a username. In Mobile V1, it does not.
The Lithium developers replied that they wouldn't be fixing it, since the issue won't exist in Mobile V2, which is to be released later in April. So I found a fix that seems to work. Hopefully this can help other Lithium customers who are still using V1.
Steps to reproduce:
1. Authenticate via SSO, such as logging into the main website, then clicking to the community
2. On the mobile community site, go to a post, and click reply.
3. The reply button does not prompt the user to Register/pick a username. It refreshes the page, but does nothing else.
Expected behavior: When a non-registered user clicks the reply button, they are prompted to choose a username on the interstitial page.
To fix, place this code in the Mobile Wrapper > Hitbox.
<#if page.name?lower_case == "mobileforumtopicpage" >
if ('${user.login}'.length == 0) {
var url = window.location.href;
if(url.indexOf("#reply-form") > -1) {
var urlNew = encodeURIComponent(url);
window.location.href = "/t5/user/ssoregistrationpage?dest_url=" + urlNew;
}
}
</#if>