Forum

Thread tagged as: Error, Runway, Members

Error thrown by Members App when saving Member page

Hello,

I'm using Runway with the Members app. I have a textarea field on the Member page that errors on save. The field populates just fine when using a front-end form.

The error is: Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\xampp\htdocs\davidmarshall\perch\core\lib\PerchUtil.class.php on line 152

Can you let me know if I'm doing something wrong, or if this is something that needs to be fixed by your good selves?

Many thanks, Jon

The part of the profile form template that populates the field is:

<perch:input type="textarea" id="wishlist" required="true" label="Wishlist" />

The Members member.html file looks like:

<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="checkbox" id="register_news" label="News updates?" value="Yes" listing="true" order="3" />
<perch:members type="textarea" id="wishlist" label="Wishlist" order="4" size="s" />

Diagnostics:


Perch Runway: 2.8.24, PHP: 5.4.22, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $, with PDO Server OS: WINNT, apache2handler Installed apps: content (2.8.24), assets (2.8.24), categories (2.8.24), perch_forms (1.8.3), collection_1 (2.8.24), perch_members (1.4.2) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', 'perch_members' ); PERCH_LOGINPATH: /perch PERCH_PATH: C:\xampp\htdocs\davidmarshall\perch PERCH_CORE: C:\xampp\htdocs\davidmarshall\perch\core PERCH_RESFILEPATH: C:\xampp\htdocs\davidmarshall\perch\resources Image manipulation: GD PHP limits: Max upload 64M, Max POST 65M, Memory: 128M, Total max file upload: 64M F1: dc1fef2ad0fcd9f943c02ebb43d85dbc Resource folder writeable: Yes HTTP_HOST: davidmarshall DOCUMENT_ROOT: C:/xampp/htdocs/davidmarshall REQUEST_URI: /perch/core/settings/diagnostics/ SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Jonathan Brain

Jonathan Brain 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Where are you getting the error?

It displays just above the textarea, once the page refreshes after the save. I can send you a screen shot if you let me know where to send it.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is this in the control panel?

Yes - on the member edit page (/perch/addons/apps/perch_members/edit/?id=<number>).

Sorry, I should've made that much clearer.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, we'll take a look and see if we can repeat it.

Hello, I'm using Members app, with Perch (not Runway) and have i think similar issue. Am getting the same warning. But on the line 169 instead of 152.

If i change type="textarea" to type="text" inside the member.html file than everything is working again. You can see than the whole text i have send before from my form textarea field. Except that the field on the member edit page is not big enough to read the text. ; ) But no warning if i save that.

Do you have an idee what could be wrong? Many thanks Lena

Here the textarea field in the Register form:

    <perch:input type="textarea" id="messagee" required="true" label="Message" class="message_news" />

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="text" id="organisation" label="Organisation" listing="true" order="3" />
<perch:members type="text" id="messagee" label="Message" size="s" order="4" />
<perch:members type="text" id="date" label="Publication Date" order="5" />

debug message inside the Member edit page, after i try to save/change the Member Details:

SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='ad0afefd0c07ce2c2d525f51eeff6333' LIMIT 1
UPDATE perch2_users SET userHash='34c202f799c4e523381f0c04b906a0f5' WHERE userID='1'
[33] SELECT p.privKey FROM perch2_user_privileges p
[28] SELECT * FROM (SELECT DISTINCT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID, settingValue, userID
[1] SELECT * FROM perch2_members WHERE memberID=51 LIMIT 1
Using template: /templates/members/member.html
UPDATE perch2_members SET memberEmail='test@email.de', memberStatus='active', memberCreated='2016-03-31', memberProperties='{\"first_name\":\"Test\",\"last_name\":\"Test\",\"organisation\":\"Organisation\",\"messagee\":{\"_flang\":\"plain\",\"raw\":\"Some Text\",\"processed\":\"Some Text\"},\"date\":\"12 September\"}' WHERE memberID='51'
No ids to log.
DELETE FROM perch2_members_member_tags WHERE memberID='51'
Using email template: /Applications/XAMPP/Sites/yara/perch/templates/members/emails/welcome.html (html)
Building message with Perch template
[1] Using template: /templates/members/emails/welcome.html
Sent email: "Welcome, your membership has been approved" to test@email.de
[nil] SELECT t.*, mt.tagExpires FROM perch2_members_member_tags mt, perch2_members_tags t WHERE mt.tagID=t.tagID AND mt.memberID='51' ORDER BY t.tag ASC
[0] SELECT COUNT(*) FROM perch2_members WHERE memberStatus='pending'
Queries: 12
Memory: 4.331

Array
(
    [type] => 2
    [message] => htmlspecialchars() expects parameter 1 to be string, array given
    [file] => /Applications/XAMPP/Sites/yara/perch/core/lib/PerchUtil.class.php
    [line] => 169
)

Diagnistics

    Perch: 2.8.27, PHP: 5.6.14, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
    Server OS: Darwin, apache2handler
    Installed apps: content (2.8.27), assets (2.8.27), categories (2.8.27), perch_forms (1.8.3), perch_members (1.4.2)
    App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', 'perch_members', );
    PERCH_LOGINPATH: /perch
    PERCH_PATH: /Applications/XAMPP/Sites/yara/perch
    PERCH_CORE: /Applications/XAMPP/Sites/yara/perch/core
    PERCH_RESFILEPATH: /Applications/XAMPP/Sites/yara/perch/resources
    Image manipulation: GD
    PHP limits: Max upload 128M, Max POST 128M, Memory: 128M, Total max file upload: 128M
    F1: 2edba60ed1f613d6dd804feb202456a2
    Resource folder writeable: Yes
    HTTP_HOST: yara.local
    DOCUMENT_ROOT: /Applications/XAMPP/Sites/yara
    REQUEST_URI: /perch/core/settings/diagnostics/
    SCRIPT_NAME: /perch/core/settings/diagnostics/index.php