Forum
Perch Members 1.6.3 > login_form template bug?
Hi
I'm experiencing a bug with the latest Members app and wanted to log it here.
I've updated a dev copy to the latest version 1.6.3 and now a members log in page is not working as expected.
The /members/login/login_form.html template is ignoring the <perch:member logged-in="true">
tag and stripping out any code above it.
Nothing has been updated in the page or the template – just the latest RW and app updates. Rolling back to RW 3.0.14 restores functionality.
Here's my template:
<section class="l-account g-quad g-vertical-spacer">
<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 class="f-standard">
<perch:error for="all" type="login">
<div class="f-error">Those details do not match our records. Please try again or <a href="/shop/register/">create a new account here</a>.</div>
</perch:error>
<div>
<perch:label for="email">Email</perch:label>
<perch:input type="email" id="email" required="true" label="Email" placeholder="Enter your email address" class="l-form-input" />
<perch:error for="email" type="required" class="f-error">Required</perch:error>
<perch:error for="email" type="format" class="f-error">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" placeholder="Enter your password" class="l-form-input" />
<perch:error for="password" type="required" class="f-error">Required</perch:error>
</div>
<div class="g-flex-row">
<div class="l-acc-action">
<perch:input type="submit" id="submit" value="Log in" class="l-btn l-btn-large" />
<perch:input type="hidden" id="r" />
<p>Forgotten your password?<br><a href="/shop/reset">Reset it now</a>.</p>
</div>
<div class="l-acc-alt">
<p>Don't have an account yet?<br>
<a href="/shop/register/">Create an account here.</a></p>
</div>
</div>
</fieldset>
</perch:form>
</perch:member>
</section>
Here's the rendered html – NB no member is logged in at the moment. Also, the section element is also missing breaking the layout.
<p>Hi , you are logged in</p>
<form id="form2_login" action="/shop/log-in" method="post">
<fieldset class="f-standard">
<div>
<label for="form2_email">Email</label>
<input id="form2_email" name="email" class="l-form-input" placeholder="Enter your email address" type="email" required="required">
</div>
<div>
<label for="form2_password">Password</label>
<input id="form2_password" name="password" class="l-form-input" placeholder="Enter your password" type="password" required="required">
</div>
<div class="g-flex-row">
<div class="l-acc-action">
<input id="form2_submit" name="submit" class="l-btn l-btn-large" value="Log in" type="submit"><input type="hidden" name="cms-form" value="bG9naW46cGVyY2hfbWVtYmVyczovdGVtcGxhdGVzL21lbWJlcnMvbG9naW4vbG9naW5fZm9ybS5odG1sOjE1MjI0MDk5MTk=">
<input id="form2_r" name="r" type="hidden">
<p>Forgotten your password?<br><a href="/shop/reset">Reset it now</a>.</p>
</div>
<div class="l-acc-alt">
<p>Don't have an account yet?<br>
<a href="/shop/register/">Create an account here.</a></p>
</div>
</div>
</fieldset>
</form>
Diagnostics:
Perch Runway: 3.1, PHP: 7.2.1, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (3.1), assets (3.1), categories (3.1), perch_forms (1.11), perch_shop_orders (1.2.6), perch_shop_products (1.2.6), perch_shop (1.2.6), perch_members (1.6.3), pipit_catalog (1.2.0), perch_mailchimp (3.1)
App runtimes: <?php $apps_list = [ 'perch_mailchimp', 'perch_members', 'perch_shop', 'perch_forms', ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/ellimondo/Dropbox/Sites/ellipress/dev.ellipress.co.uk/perch
PERCH_CORE: /Users/ellimondo/Dropbox/Sites/ellipress/dev.ellipress.co.uk/perch/core
PERCH_RESFILEPATH: /Users/ellimondo/Dropbox/Sites/ellipress/dev.ellipress.co.uk/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 8M, Memory: 128M, Total max file upload: 8M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: dev.ellipress.co.uk
DOCUMENT_ROOT: /Users/ellimondo/Dropbox/Sites/ellipress/dev.ellipress.co.uk
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
I don't think
<perch:else:member/>
requires the slash. It should just be<perch:else:member>
.See https://docs.grabaperch.com/templates/apps/members/logged-in/
Don't know if this will fix the problem but might be worth a try.
Thanks Caleb. Tried it already and it doesn't work – forward slashed close tags should be backward compatible anyway.
This template hasn't changed since previous version, when it was working fine. Code is also as per template supplied in the app.
It's a bug. I've fixed it, so just rounding up a few last things before releasing 3.1.1
Thanks Drew. Was it an Easter Egg?
Happy Easter,
Jon
That's working great now thanks Drew.