Forum
Forms not storing responses
Hi all,
I have tried to ensure I've covered everything before posting here, but I am stumped!
I have two forms on a site in development on my servre, both forms submit and a success message appears for one, and a redirect as per the form settings for the other.
However the form entry in the back end is empty when testing on my server, yet it works fine on my local site (using WAMP)
The dev site on the server is a duplicate of my local, so it suggests something config based, I've turned on debug and there is an error retrieving a content template that seems to be a pathing issue, but I can't figure out where this path is being generated. The path has a mixture of forward and back slashes but I'm not sure where from, am I missing something obvious?
Error is
Array
(
[type] => 2
[message] => file_get_contents(/var/www/stanburychameleon/perch\templates\content\client_area_upload_form.html): failed to open stream: No such file or directory
[file] => /var/www/stanburychameleon/perch/core/lib/api/PerchAPI_SubmittedForm.class.php
[line] => 411
)
However my templates look like so
Page Template
<?php
// You can find this in tempates/layouts/global
include($_SERVER['DOCUMENT_ROOT'].'/perch/runtime.php');
perch_layout('global/top', [
'body-class' => 'client-area',
'title'=>perch_pages_title(true), // pass page title in to this layout
]);
perch_layout('global/header');
perch_layout('client-area/upload-form');
perch_layout('common/testimonials-bar');
perch_layout('common/nav-block-bar');
perch_layout('common/feature-bar');
perch_layout('global/logo-bar');
perch_layout('global/footer');
perch_layout('global/bottom');
?>
in turn the Perch layout named "upload-form" has a Perch region like so
<?php perch_content('Client Upload Form'); ?>
and that is then referencing a template called client_area_upload_form.html that looks like so
<section class="bar-tertiary" data-ui-component="upload-form">
<div class="container">
<div class="row">
<div class="col-md-7">
<perch:form id="client_Upload_Form" method="post" app="perch_forms">
<div class="form-group">
<perch:label for="clientName">Your Name</perch:label>
<perch:input type="text" id="clientName" required="true" label="clientName" />
<perch:error for="clientName" type="required">Please add your name</perch:error>
</div>
<div class="form-group">
<perch:label for="clientEmail">Your Email</perch:label>
<perch:input type="email" id="clientEmail" required="true" label="clientEmail" />
<perch:error for="clientEmail" type="required">Please add your email address</perch:error>
<perch:error for="clientEmail" type="format">Please check your email address</perch:error>
</div>
<div class="form-group">
<perch:label for="clientMessage">Message</perch:label>
<perch:input type="textarea" id="clientMessage" />
</div>
<div class="form-group">
<perch:label for="clientDocument">Your Artwork <span>(.pdf,.zip - Max size 20MB)</span></perch:label>
<perch:input type="file" id="clientDocument" accept="pdf zip" bucket="Client Artwork" />
<perch:error for="clientDocument" type="required">Please upload your art work</perch:error>
</div>
<div class="form-group">
<perch:input type="text" id="banana" antispam="honeypot" class="additional" />
<perch:input type="submit" id="clientSubmitArtwork" value="Submit" class="btn btn-primary" />
</div>
<perch:success>
<perch:content id="success" type="textarea" label="Success Text" html="true" editor="redactor" />
</perch:success>
</perch:form>
</div>
<div class="col-md-4 col-md-offset-1 side-bar">
<h2>Upload your artwork</h2>
<p>Lorem ipsum dolor sit amet</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.</p>
</div>
</div>
</div>
</section>
I've also checked the DB and sure enough the "formTemplate" column in perch2_forms shows the template paths with backslashes i.e \templates\content\global_footer_form.html
If I manually edit this, am I going to screw anything else up?
Many thanks
Lee
Here is a copy of my diagnostics also if needed.
It's because you're moving between different types of file systems. Delete the entry for the form within the control panel, and then resubmit it.