Forum
Members v1.0.3
Drew:
A while back I discovered the members app would crash on my local server, but work fine online. You and I tried to troubleshoot the issue but never figured out the problem....
AHHHH today, I got really persistent and I found the problem.
(default perch_members template login_form.html)
<perch:member logged-in="true">
<p>Hi <perch:member id="first_name" />, you are logged in</p>
<perch:else:member />
<perch:form id="login" method="post" app="perch_members">
<fieldset>
<legend>Log in</legend>
<perch:error for="all" type="login">
<p class="error">Those details do not match our records.</p>
</perch:error>
<div>
<perch:label for="email">Email</perch:label>
<perch:input type="email" id="email" required="true" label="Email" />
<perch:error for="email" type="required">Required</perch:error>
<perch:error for="email" type="format">Check format of address</perch:error>
</div>
<div>
<perch:label for="password">Password</perch:label>
<perch:input type="password" id="password" required="true" label="Password" />
<perch:error for="password" type="required">Required</perch:error>
</div>
<div>
<perch:input type="submit" id="submit" value="Log in" />
<perch:input type="hidden" id="r" />
<p>Forgotten your password? <a href="/members/reset.php">Reset it now</a>.</p>
</div>
</fieldset>
</perch:form>
</perch:member>
(corrected template) see comment on line 1
<perch:if:member logged-in="true"> // if: missing from the default template... added if: and everything is working now
<p>Hi <perch:member id="first_name" />, you are logged in</p>
<perch:else:member />
<perch:form id="login" method="post" app="perch_members">
<fieldset>
<legend>Log in</legend>
<perch:error for="all" type="login">
<p class="error">Those details do not match our records.</p>
</perch:error>
<div>
<perch:label for="email">Email</perch:label>
<perch:input type="email" id="email" required="true" label="Email" />
<perch:error for="email" type="required">Required</perch:error>
<perch:error for="email" type="format">Check format of address</perch:error>
</div>
<div>
<perch:label for="password">Password</perch:label>
<perch:input type="password" id="password" required="true" label="Password" />
<perch:error for="password" type="required">Required</perch:error>
</div>
<div>
<perch:input type="submit" id="submit" value="Log in" />
<perch:input type="hidden" id="r" />
<p>Forgotten your password? <a href="/members/reset.php">Reset it now</a>.</p>
</div>
</fieldset>
</perch:form>
</perch:member>
I wanted to let you know I figured it out and I'm no longer going CRAZY on my local machine. Maybe this can be fixed in the default v1.0.3 download files.
There is no
perch:if:member
tag.Why is there an else without an if?
There is essentially an if (we're testing to see if the member is logged in)
Docs are here: https://docs.grabaperch.com/docs/members/template-tags/logged-in/
Thank you Rachel,
I have to tell you the members app crashes when using the default template. I made the changes above and then it works... change it back to default and it crashes again. I have made no changes to the core app or perch. But this isn't an issue online, just my development server.
Well the fix you have suggested isn't a fix as you are using a tag that doesn't exist. It may mask the actual issue you are having by just causing a bunch of code to be skipped over or something like that.
We're not have this issue reported by anyone else so it must be something in your local environment that is causing the issue. I'm not sure what you mean by "crash", is Apache crashing, or your browser?
Browser. Returns: This webpage is not available.
If I totally delete the perch:member loggen-in then it functions without error.
What's the real error in the log? That's just a browser generated message.
Well, There are no errors in the logs, so I guess its a dead subject.
I dont think its worth all this time anymore. So lets just close ticket.
Is your dev server Apache on Windows?
I had almost the same problem (members app default login form causing crash, just returned a blank page) last week and traced it to a preg_replace call in one of the members classes.
The solution was to increase the stack size for Apache: https://stackoverflow.com/questions/5058845/how-do-i-increase-the-stack-size-for-apache-running-under-windows-7
Simon, Your my hero... You solved my problem.