Forum

Thread tagged as: Problem, Forms

Updating from 2.8.4

I'm trying to add a new contact form. Its created using the same template with a different form ID as all previous ones on the site. It is displaying fine, but not showing up in the Forms app when I submit it.

I'm wondering if it might get resolved if I update Perch as its pretty out of date. I'm currently on 2.8.4.

Am I likely to come across any problems when I make such a jump in updating?

My diagnostic report is:

Perch: 2.8.4, PHP: 5.3.29, MySQL: 5.6.31, with PDO Server OS: Linux, cgi-cgi Installed apps: content (2.8.4), assets (2.8.4), categories (2.8.4), perch_blog (4.1), perch_forms (1.7), perch_members (1.0.3), perch_podcasts (1.0) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_forms', 'perch_members', 'perch_podcasts', ); PERCH_LOGINPATH: /perch PERCH_PATH: /home/stirlingbaptist/public_html/perch PERCH_CORE: /home/stirlingbaptist/public_html/perch/core PERCH_RESFILEPATH: /home/stirlingbaptist/public_html/perch/resources Image manipulation: GD Imagick PHP limits: Max upload 128M, Max POST 128M, Memory: 128M, Total max file upload: 128M Resource folder writeable: Yes DOCUMENT_ROOT: /home/stirlingbaptist/public_html HTTP_HOST: stirlingbaptist.org REQUEST_URI: /perch/core/settings/diagnostics/ SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Philip Young

Philip Young 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

No, you should be fine to update.

Thanks Drew. I have updated successfully.

Still not got a working form unfortunately.

I have set it up in exactly the same as the other forms on the pages.

I have 4 other forms that are a page template, then it pulls in a specific 'content template' that has the form HTML and the only difference between them is their id is unique. All current 4 works great through the Forms app.

Previously, these just showed up in the Forms app when you submitted the first form. But this new one is not.

How can I work out whats going wrong?

Thanks.

This is my template for one of the forms that works currently :


<div class="general-title"> <p class="lead"><perch:content id="contactformheading" type="text" label="Contact Form Heading" /></p> </div><!-- end general title -->
<div class="contact_form"> <div id="message"></div>

            <perch:form id="pastoral-support-page" method="post" app="perch_forms" name="contactform">
                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                    <perch:input type="text" id="name" required="true" label="Name"  class="form-control" placeholder="Name" />
                    <perch:input type="text" id="email" required="true" label="Email"  class="form-control" placeholder="Email Address" />
                    <perch:error for="email" type="format" class="form-control">Please check your email address</perch:error>
                    <perch:input type="text" id="phone" required="false" label="Phone"  class="form-control" placeholder="Phone Number" />
                </div>
                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                    <perch:input type="text" id="subject" required="true" label="Subject"  class="form-control" placeholder="Subject" />
                    <perch:input type="textarea" id="message" required="true" label="Message"  class="form-control" placeholder="Message" rows="6" /> 
                    <perch:input type="submit" id="submit" value="Send" class="btn btn-lg btn-primary pull-right" />
                </div>
            </perch:form>    

</div><!-- end contact-form -->

And this is the new form that I am trying to get working.


        <div class="general-title">
            <p class="lead"><perch:content id="contactformheading" type="text" label="Contact Form Heading" /></p>
        </div><!-- end general title -->    
        <div class="contact_form">
            <div id="message"></div>

            <perch:form id="artist-in-residence-page" method="post" app="perch_forms" name="contactform">
                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                    <perch:input type="text" id="name" required="true" label="Name"  class="form-control" placeholder="Name" />
                    <perch:input type="text" id="email" required="true" label="Email"  class="form-control" placeholder="Email Address" />
                    <perch:error for="email" type="format" class="form-control">Please check your email address</perch:error>
                    <perch:input type="text" id="phone" required="false" label="Phone"  class="form-control" placeholder="Phone Number" />
                </div>
                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                    <perch:input type="text" id="subject" required="true" label="Subject"  class="form-control" placeholder="Subject" />
                    <perch:input type="textarea" id="message" required="true" label="Message"  class="form-control" placeholder="Message" rows="6" /> 
                    <perch:input type="submit" id="submit" value="Send" class="btn btn-lg btn-primary pull-right" />
                </div>
            </perch:form>    

        </div><!-- end contact-form -->

the only difference is the form ID

Drew McLellan

Drew McLellan 2638 points
Perch Support

Dashes aren't legal in IDs for Perch tags, so that would be the first thing to try.

OK. I'll give that a go.

All my other forms have dashes in them and they work.

What will happen if I change them? Will they reset in Perch or just continue to work ok?

Drew McLellan

Drew McLellan 2638 points
Perch Support

They'll reset. If they're working now then that's probably not it, but you should plan to correct them because I can't guarantee they'll always work.

I'm on Forms App 1.7.

Should I update that too?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, you should update any old software you're using.

I'm updated and removed the dashes. Still not showing in Forms app.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you turn on debug and then let me know what it outputs on the page after submitting the form?

This is from the page the form is on :

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='5a4fee21882685711f1296c7ea4ab49d' LIMIT 1
UPDATE perch2_users SET userHash='ebe9a6fb3e38f2be6599582bb201c442' WHERE userID='1'
[82] SELECT p.privKey FROM perch2_user_privileges p
[26] 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_pages WHERE pageID=122 LIMIT 1
[12] SELECT * FROM perch2_content_regions WHERE pageID=122 AND regionPage!='*' ORDER BY regionOrder ASC
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=806 AND itemRev=1
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=807 AND itemRev=1
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=808 AND itemRev=2
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=809 AND itemRev=2
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=810 AND itemRev=1
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=811 AND itemRev=1
[0] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=831 AND itemRev=0
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=840 AND itemRev=1
[0] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=814 AND itemRev=0
[1] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=815 AND itemRev=4
[0] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=816 AND itemRev=0
[0] SELECT COUNT(*) FROM perch2_content_items WHERE itemJSON!='' AND regionID=817 AND itemRev=0

And this if from the forms app :

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='4e9ec459bbde91a3d78a25a23b110fac' LIMIT 1
UPDATE perch2_users SET userHash='8ad91b60bea12dbd293c3193f24828db' WHERE userID='1'
[82] SELECT p.privKey FROM perch2_user_privileges p
[26] 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
[4] SELECT * FROM perch2_forms
[0] SELECT COUNT(*) AS qty FROM perch2_forms_responses WHERE formID=5 AND responseSpam=0
[0] SELECT responseCreated FROM perch2_forms_responses WHERE formID=5 ORDER BY responseCreated DESC LIMIT 1
[0] SELECT COUNT(*) AS qty FROM perch2_forms_responses WHERE formID=4 AND responseSpam=0
[0] SELECT responseCreated FROM perch2_forms_responses WHERE formID=4 ORDER BY responseCreated DESC LIMIT 1
[0] SELECT COUNT(*) AS qty FROM perch2_forms_responses WHERE formID=3 AND responseSpam=0
[0] SELECT responseCreated FROM perch2_forms_responses WHERE formID=3 ORDER BY responseCreated DESC LIMIT 1
[0] SELECT COUNT(*) AS qty FROM perch2_forms_responses WHERE formID=6 AND responseSpam=0
[0] SELECT responseCreated FROM perch2_forms_responses WHERE formID=6 ORDER BY responseCreated DESC LIMIT 1
Drew McLellan

Drew McLellan 2638 points
Perch Support

Both of those look like output from the control panel. What about the page with the form on? I need to see what happens when the form is submitted.

Sorry.

SELECT * FROM perch2_pages WHERE pagePath='/artist-in-residence.php' LIMIT 1
[23] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/artist-in-residence.php' OR regionPage='*' ORDER BY regionPage DESC
[38] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=4 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/artist-in-residence.php' LIMIT 1
[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-003-008', '000-003', '000') ORDER BY pageTreePosition DESC
[6] Using template: /templates/navigation/sbc.nav.test.html
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch2_pages WHERE pagePath='/artist-in-residence.php' OR pageSortPath='/artist-in-residence.php' LIMIT 1
[1] SELECT pageID, pageParentID, pageDepth, pageTreePosition FROM perch2_pages WHERE pageTreePosition='000-003' LIMIT 1
[8] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageTreePosition LIKE '000-003%' ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/artist-in-residence.php' LIMIT 1
[2] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-003-008', '000-003', '000') ORDER BY pageTreePosition DESC

and the output HTML from that page :


<div class="contact_form"> <div id="message"></div>

            <form id="form1_artistinresidencepage" action="/artist-in-residence.php" method="post" name="contactform">
                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                    <input id="form1_name" name="name" class="form-control" placeholder="Name" type="text" required="required" />
                    <input id="form1_email" name="email" class="form-control" placeholder="Email Address" type="text" required="required" />

                    <input id="form1_phone" name="phone" class="form-control" placeholder="Phone Number" type="text" required="required" />
                </div>
                <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                    <input id="form1_subject" name="subject" class="form-control" placeholder="Subject" type="text" required="required" />
                    <textarea id="form1_message" name="message" class="form-control" cols="30" rows="6" placeholder="Message" required="required"></textarea> 
                    <input id="form1_submit" name="submit" class="btn btn-lg btn-primary pull-right" value="Send" type="submit" /><input type="hidden" name="cms-form" value="YXJ0aXN0aW5yZXNpZGVuY2VwYWdlOnBlcmNoX2Zvcm1zOi90ZW1wbGF0ZXMvY29udGVudC9jb250YWN0X2Zvcm1fYXJ0aXN0X2luX3Jlc2lkZW5jZS5odG1sOjE0NzQzODUwOTU=" />
                </div>
            </form>    

        </div><!-- end contact-form -->

Drew McLellan

Drew McLellan 2638 points
Perch Support

There's no indication that the form has been submitted at all. Do you have anything else going on on this server that might influence it?