Forum

Thread tagged as: Question, Forms

Forms ReplyTo email address

I've updated to the latest Perch and Forms app to use the new ReplyTo header option.

In the form settings there is an empty select box for the email address. How can I populate this?

I wondered if it needed a stored form response to allow me to select a field to use from a form entry. Turning this on and sending a new response has not made a difference. Or am I meant to be able to type something in e.g. {email}?

I did see the 1.8.1 forms update and applied that with the same result.

Diagnostics

Perch: 2.7.2, PHP: 5.6.2, MySQL: 5.5.38, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (2.7.2), assets (2.7.2), categories (2.7.2), perch_forms (1.8.1), perch_backup (1.2)
App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_forms/runtime.php'); ?>
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/tombedford/Dropbox/Sites/dorsetloc.org/perch
PERCH_CORE: /Users/tombedford/Dropbox/Sites/dorsetloc.org/perch/core
PERCH_RESFILEPATH: /Users/tombedford/Dropbox/Sites/dorsetloc.org/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
Resource folder writeable: Yes
HTTP_HOST: dorsetloc.localhost
DOCUMENT_ROOT: /Users/tombedford/Dropbox/Sites/dorsetloc.org
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Tom Bedford

Tom Bedford 3 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show me your form template?

<perch:content id="contact_text" label="Page Text" type="textarea" editor="ckeditor" html="true" help="Press Shift+Enter for a new line without a space above it." required="true" />

<perch:form id="contact" method="post" app="perch_forms">
    <fieldset class="noborder">
        <perch:label for="name">Name</perch:label>
        <perch:input class="form-text" type="text" id="name" required="true" label="Name" antispam="name" />
        <perch:error for="name" type="required">
            <p class="error">Please add a your name.</p>
        </perch:error>
    </fieldset>

    <fieldset class="noborder">
        <perch:label for="email">Email</perch:label>
        <perch:input class="form-text" type="email" id="email" required="true" label="Email" placeholder="you@example.com" antispam="email" />
        <perch:error for="email" type="required">
            <p class="error">Please add a your email address.</p>
        </perch:error>
        <perch:error for="email" type="format">
            <p class="error">Please check a your email address.</p>
        </perch:error>
    </fieldset>

    <fieldset>
        <perch:label for="message">Message</perch:label>
        <perch:input type="textarea" id="message" required="true" label="Message" antispam="body" />
        <perch:error for="message" type="required">
            <p class="error">Please add a message.</p>
        </perch:error>
    </fieldset>

    <fieldset class="form-actions">
        <perch:input type="submit" value="Send Message" />
    </fieldset>

    <perch:success>
        <perch:content id="contact_form_success" label="Contact Form Sent Message" type="textarea" editor="ckeditor" html="true" help="Press Shift+Enter for a new line without a space above it." required="true" />
    </perch:success>
</perch:form>
Drew McLellan

Drew McLellan 2638 points
Perch Support

That looks ok. I'm not sure why it's not finding your IDs.

Can you turn on debug and let me know what it outputs at the bottom of that page?

Time    Δ  Message
0.0123  0   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='aa93841a1f52d4f41bf34010660a737f' LIMIT 1
0.0126  0.0003  UPDATE perch2_users SET userHash='dca4a39776664323e23353330c651b0a' WHERE userID=1
0.0128  0.0002  SELECT p.privKey FROM perch2_user_privileges p
0.014   0.0013  SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID
0.0379  0.0239  SELECT * FROM perch2_forms WHERE formID=1 LIMIT 1
0.0457  0.0078  Template file not found: /Users/tombedford/Dropbox/Sites/dorsetloc.org/perch/addons/apps/perch_forms/templates/\templates\content\contact.html
0.0472  0.0015  Queries: 6

Looks like it can't find my template.

It's in /perch/templates/content/contact.html - do I need to move it?

Drew McLellan

Drew McLellan 2638 points
Perch Support

No I think that's just a bug.

I've updated to forms 1.8.2 and see the same issue. The debug code isn't giving an error about the template now, however the select box remains empty.

I submitted a new form entry to see if that was needed. I also tried using the template from the docs to check it wasn't my template.

This has all been on my local setup, could it behave differently on a live server?

Current debug info:

Time    Δ  Message
0.0145  0   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='ae63d34e2704379312b6bc569a6840dd' LIMIT 1
0.0149  0.0004  UPDATE perch2_users SET userHash='96d885053b883e1bc2ba9a91f6a57a5a' WHERE userID=1
0.0151  0.0002  SELECT p.privKey FROM perch2_user_privileges p
0.0169  0.0017  SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID
0.0392  0.0223  SELECT * FROM perch2_forms WHERE formID=1 LIMIT 1
0.0438  0.0047  Queries: 6
Drew McLellan

Drew McLellan 2638 points
Perch Support

That's surprising.

Are you able to delete the form within the Forms app and set it up again?

Deleting the form and setting it up again works.

I can export old responses - is there a way to import them so they stay in Perch after updating? Otherwise they are lost from the interface due to deleting the form.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think that's a required step, generally.

My concern was if I'm upgrading several sites then it wouldn't be great to lose all the old responses in order to gain the new functionality.

Was my experience a one off or would I need to delete the old form and set up again for all upgrades?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'd hope it was a one-off.