We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Question, Members

Members App, Doesn't seem to play well with textarea's

In my member.html I am using a textarea field and this saves, then the member is able to edit and all works well.

The issue is when an admin edits the textarea... at first the data is present, when the admin saves and you get conformation the changes have been saved. Now the admin textarea is empty but the data has been updated in member profile.

When the form is saved by member it is saved into the database as a variable, but when the admin saves the data is saved as an array in the database.

Robert Ketter

Robert Ketter 103 points

  • 4 years ago

register.html

<perch:form id="register" method="post" app="perch_members" type="default">
    <div>
        <perch:label for="first_name">First name</perch:label>
        <perch:input type="text" id="first_name" required="true" label="First name" />
        <perch:error for="first_name" type="required">Please add your name</perch:error>
    </div>
    <div>
        <perch:label for="last_name">Last name</perch:label>
        <perch:input type="text" id="last_name" required="true" label="Last name" />
        <perch:error for="last_name" type="required">Please add your name</perch:error>
    </div>
    <div>
        <perch:label for="email">Email</perch:label>
        <perch:input type="email" id="email" required="true" placeholder="you@company.com" helper="PerchMembers_Members::check_email" />
        <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>
        <perch:label for="password">Password</perch:label>
        <perch:input type="password" id="password" required="true" match-with="password2" />
        <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>
        <perch:label for="password2">Password again</perch:label>
        <perch:input type="password" id="password2" required="true" />
        <perch:error for="password2" type="required">Please repeat your password</perch:error>
    </div>
    <div>
        <perch:label for="directions">Directions to your home.</perch:label>
        <perch:input type="text" id="directions" required="true" label="Directions to your home" />
        <perch:error for="directions" type="required">Please add a your directions</perch:error>
    </div>
    <div>
        <perch:input type="submit" value="Register" />
    </div>
    <perch:success>
        <p>Thanks!</p>
    </perch:success>
</perch:form>

saves in database as {"first_name":"Silly","last_name":"Me","directions":"Go west 250 feet"}

member.html

<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="textarea" id="directions" label="Directions to Home" required="true" />

saves in database as {"first_name":"Silly","last_name":"Me","directions":{"_flang":"plain","raw":"Go west 250 feet","processed":"Go west 250 feet"}}

...but then the directions field is empty after admin save, yet the database is updated as seen above.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Please post your Diagnostics Report - thanks!

Perch Runway: 3.0b8, PHP: 5.6.23, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: WINNT, apache2handler
Installed apps: content (3.0b8), assets (3.0b8), categories (3.0b8), perch_forms (1.9), perch_members (1.5), ketterus_collections (2.0)
App runtimes: <?php $apps_list = [ 'perch_members', 'perch_forms', 'ketterus_collections' ];
PERCH_LOGINPATH: /perch
PERCH_PATH: D:\xampp\htdocs\perch
PERCH_CORE: D:\xampp\htdocs\perch\core
PERCH_RESFILEPATH: D:\xampp\htdocs\perch\resources
Image manipulation: GD
PHP limits: Max upload 500M, Max POST 8M, Memory: 128M, Total max file upload: 8M
F1: 4d9310cb3334aecba6deb7af73647aaf
Resource folder writeable: Yes
HTTP_HOST: ketter.local
DOCUMENT_ROOT: D:/xampp/htdocs
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Rachel Andrew

Rachel Andrew 394 points
Perch Support

As explained in the beta Slack, the Members App does not work with the beta. So you should not expect it to work, it has not been updated. Only those add-ons available for download as part of the beta work, and issues with those should be reported in the beta Slack.

Sorry, I sent the info for the wrong server...

Here is the right one, and for what its worth, the problem is exactly the same.

SUMMARY INFORMATION

Perch Runway: 2.8.34, PHP: 7.0.13-0ubuntu0.16.04.1, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.8.34), assets (2.8.34), categories (2.8.34), perch_members (1.5)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_members', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /var/www/html/perch
PERCH_CORE: /var/www/html/perch/core
PERCH_RESFILEPATH: /var/www/html/perch/resources
Image manipulation: GD
PHP limits: Max upload 10M, Max POST 8M, Memory: 128M, Total max file upload: 8M
F1: 6a33f95eca3667f9e0c39bf5ca2980fe
Resource folder writeable: Yes
HTTP_HOST: 45.55.151.65
DOCUMENT_ROOT: /var/www/html
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that's a known issue. You can't edit the same data from both sides.

Drew McLellan said:

Yes, that's a known issue. You can't edit the same data from both sides.

With all the free time you have, you haven't fixed a known issue?? lol :)

OK, as long as I know I didn't break it.

Crazy thing is, text fields work wonderful, but textarea hits a brick wall. I understand why admin stores as array(). This is actually been a known issue for a long time on my part, I just finally got around to asking for conformation.

RK

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, elemental types will work fine. Compound types will not.