Forum

Thread tagged as: Problem, Addons, Members

Perch members lose properties after activation

Hi,

I have built a custom form for registration on my site. I used the supplied example from the addons folder and copied it over to perch/members/templates/forms/register.html. Then I added some fields (see below) and all works fine, confirmed by examining the database and looking at the memberProperties field. All the fields filled in on the form are present. And the new member appears as expected on a listing/table in my site. So all good so far. However, when I go into the backend and change the members status from 'pending' to 'active' and then check the database, the additional fields have gone and I am left with only first_name and last_name. What could the problem be?

In development so running on localhost. Codebase available on Gitlab. Template and Diags follow:

<perch:form id="register" method="post" app="perch_members" type="anon" class="form-horizontal">
<div class="row">
<div class="col-sm-12 col-md-6">
    <div class="well">
    <div class="form-set">
        <perch:label for="first_name">First name</perch:label>
        <perch:input type="text" id="first_name" required="true" label="First name" class="form-control" />
        <perch:error for="first_name" type="required">Please add your name</perch:error>
    </div>
    <div class="form-set">
        <perch:label for="last_name">Last name</perch:label>
        <perch:input type="text" id="last_name" required="true" label="Last Name" class="form-control" />
        <perch:error for="last_name" type="required">Please add your name</perch:error>
    </div>
    <div class="form-set">
        <perch:label for="email">Email</perch:label>
        <perch:input type="email" id="email" required="true" placeholder="you@company.com" helper="PerchMembers_Members::check_email" class="form-control" />
        <perch:error for="email" type="required">Please add your email address</perch:error>
        <perch:error for="email" type="helper">That email address is already in use</perch:error>
    </div>
    <div class="form-set">
        <perch:label for="country">Country</perch:label>
        <perch:input type="text" id="country" label="Country" class="form-control" />
    </div>
    <div>
        <perch:label>Options</perch:label>
    </div>
    <div class="form-set">
        <perch:label for="organisation">Organisation</perch:label>
        <perch:input type="text" id="organisation" label="Organisation" class="form-control" />
    </div>
    <div class="form-set">
        <perch:label for="comments">Comments</perch:label>
        <perch:input type="text" id="comments" label="Comments" class="form-control" />
    </div>
    <div class="form-set">
        <perch:label for="involvement">Involvement</perch:label>
        <perch:input type="select" id="involvement" label="Involvement" class="form-control" options="None|0,Patient Partner|2,Clinical Partner|3,Research Partner|4,Other|9"/>
    </div>
    <div class="form-set">
        <perch:label for="area">Area</perch:label>
        <perch:input type="select" id="area" label="Area" class="form-control" options="None|0,Wolfram|1,Alstrom|2,Bardet Biedl|3,Other|9"/>
    </div>
    <div class="form-set">
    <div class="checkbox">
        <perch:label for="maillist">
        <perch:input type="checkbox" id="maillist" value="true" />Mailing List</perch:label>
    </div>
    <div class="checkbox">
        <perch:label for="registry">
        <perch:input type="checkbox" id="registry" value="true" />Require Euro-WABB database login</perch:label>
    </div>
    </div>
    <div class="form-set">
        <perch:label for="password">Password</perch:label>
        <perch:input type="password" id="password" required="true" match-with="password2" class="form-control" />
        <perch:error for="password" type="required">Please add a password</perch:error>
        <perch:error for="password" type="match">Passwords do not match</perch:error>
    </div>
    <div class="form-set">
        <perch:label for="password2">Password again</perch:label>
        <perch:input type="password" id="password2" required="true" class="form-control" />
        <perch:error for="password2" type="required">Please repeat your password</perch:error>
    </div>
    <div class="form-set">
        <perch:input type="submit" value="Register" class="btn btn-success"/>
    </div>
</div>
</div>
    <perch:success>
        <p>Thanks!</p>
        <p>Your registration should be approved within 7 days. You will receive an email confirmation.</p>
    </perch:success>
</div>
</perch:form>
Perch: 2.8.26, PHP: 5.5.9-1ubuntu4.11, MySQL: 5.5.43, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.8.26), assets (2.8.26), categories (2.8.26), perch_members (1.4.2)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_members' );
PERCH_LOGINPATH: /perch
PERCH_PATH: /var/www/euro/eurowabb/perch
PERCH_CORE: /var/www/euro/eurowabb/perch/core
PERCH_RESFILEPATH: /var/www/euro/eurowabb/perch/resources
Image manipulation: GD
PHP limits: Max upload 16M, Max POST 8M, Memory: 128M, Total max file upload: 8M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: localhost
DOCUMENT_ROOT: /var/www/euro/eurowabb/
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Dave Mellett

Dave Mellett 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Did you add your extra fields to the standard member.html template?

No. Should I do this and copy it across to perch/templates?

Perfect. Thanks Drew. For the record, here's my member.html, copied from the addons folder into perch/members/templates/members and including fields to match the registration template:

 <perch:members type="text" id="first_name" label="First name" listing="true" order="1" />
<perch:members type="text" id="last_name" label="Last name" listing="true" order="2" />
<perch:members type="text" id="country" label="Country" listing="true" order="3"/>
<perch:members type="text" id="organisation" label="Organisation" listing="true" order="4" />
<perch:members type="text" id="comments" label="Comments" listing="true" order="5" />
<perch:members type="select" id="involvement" label="Involvement" listing="true" order="6" options="None|0,Patient Partner|2,Clinical Partner|3,Research Partner|4,Other|9"/>
<perch:members type="select" id="area" label="Area" listing="true" order="7" options="None|0,Wolfram|1,Alstrom|2,Bardet Biedl|3,Other|9"/>
<perch:members type="checkbox" id="maillist" value="true" label="Mailing List" listing="true" order="8" />
<perch:members type="checkbox" id="registry" value="true" label="Require Euro-WABB database login" listing="true" order="9"/>

Now I can edit member properties from the back end. Happy Easter.

D