Forum

Thread tagged as: Problem, Error, Forms

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

Lee Goodman

Lee Goodman 0 points

  • 5 years ago

Here is a copy of my diagnostics also if needed.


PERCH INFORMATION Perch: 2.8.18 Production mode: Production (100) Installed apps: content (2.8.18), assets (2.8.18), categories (2.8.18), perch_forms (1.8.3) DB driver: PDO DB tables: perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_forms, perch2_forms_responses, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users Users: 1 App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', ); Editor plug-ins: markitup, redactor H1: 013f4f99f25005fb4d0482e6cc2bac4b L1: 65028a9f1327df4db39c08fa306bc6ca headerColour: #ffffff content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 0 content_collapseList: 1 lang: en-gb update_2.8.18: done latest_version: 2.8.15 on_sale_version: 2.8.18 PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: <dbuser> PERCH_DB_SERVER: localhost PERCH_DB_DATABASE: <mywebsite> PERCH_DB_PREFIX: perch2_ PERCH_TZ: Europe/London PERCH_EMAIL_FROM: <myemail> PERCH_EMAIL_FROM_NAME: Lee Goodman PERCH_LOGINPATH: /perch PERCH_PATH: /var/www/<mywebsite>/perch PERCH_CORE: /var/www/<mywebsite>/perch/core PERCH_RESFILEPATH: /var/www/<mywebsite>/perch/resources PERCH_RESPATH: /perch/resources PERCH_HTML5: 1 PERCH_DEBUG: 1 PERCH_RUNWAY: PERCH_ERROR_MODE: DIE PERCH_DATE_LONG: %d %B %Y PERCH_DATE_SHORT: %d %b %Y PERCH_TIME_SHORT: %H:%M PERCH_TIME_LONG: %H:%M:%S PERCH_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /var/www/<mywebsite>/perch/templates PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_PRODUCTION_MODE: 100 PERCH_RWD: PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_STRIPSLASHES: PERCH_PROGRESSIVE_FLUSH: 1 PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: PERCH_SESSION_TIMEOUT_MINS: 20 HOSTING SETTINGS PHP: 5.5.9-1ubuntu4.9 Zend: 2.5.0 OS: Linux SAPI: apache2handler Safe mode: not detected MySQL client: 5.5.43 MySQL server: 5.5.37-0ubuntu0.14.04.1 Extensions: Core, date, ereg, libxml, openssl, pcre, zlib, bcmath, bz2, calendar, ctype, dba, dom, hash, fileinfo, filter, ftp, gettext, SPL, iconv, mbstring, session, posix, Reflection, standard, shmop, SimpleXML, soap, sockets, Phar, exif, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, zip, apache2handler, PDO, curl, gd, json, mysql, mysqli, pdo_mysql, readline, ssh2, mhash, Zend OPcache GD: Yes ImageMagick: No PHP max upload size: 20M PHP max form post size: 8M PHP memory limit: 128M Total max uploadable file size: 8M Resource folder writeable: Yes Session timeout: 24 minutes Native JSON: Yes Filter functions: Yes Transliteration functions: No HTTP_HOST: <mywebsite>.getunified.co.uk HTTP_CONNECTION: keep-alive HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 HTTP_UPGRADE_INSECURE_REQUESTS: 1 HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36 HTTP_REFERER: https://<mywebsite>.getunified.co.uk/perch/core/settings/diagnostics/ HTTP_ACCEPT_ENCODING: gzip, deflate, sdch HTTP_ACCEPT_LANGUAGE: en-GB,en-US;q=0.8,en;q=0.6 HTTP_COOKIE: _ga=GA1.3.127560601.1399018215; cmsa=1; PHPSESSID=vl8vur3b7013p36b5dhujre782 PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin SERVER_SIGNATURE: <address>Apache/2.4.7 (Ubuntu) Server at <mywebsite>.getunified.co.uk Port 80</address> SERVER_SOFTWARE: Apache/2.4.7 (Ubuntu) SERVER_NAME: <mywebsite>.getunified.co.uk SERVER_ADDR: 146.185.150.252 SERVER_PORT: 80 REMOTE_ADDR: 86.9.144.47 DOCUMENT_ROOT: /var/www/<mywebsite> REQUEST_SCHEME: http CONTEXT_DOCUMENT_ROOT: /var/www/<mywebsite> SERVER_ADMIN: [no address given] SCRIPT_FILENAME: /var/www/<mywebsite>/perch/core/settings/diagnostics/index.php REMOTE_PORT: 16571 GATEWAY_INTERFACE: CGI/1.1 SERVER_PROTOCOL: HTTP/1.1 REQUEST_METHOD: GET QUERY_STRING: extended REQUEST_URI: /perch/core/settings/diagnostics/?extended SCRIPT_NAME: /perch/core/settings/diagnostics/index.php PHP_SELF: /perch/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1449591526.974 REQUEST_TIME: 1449591526
Drew McLellan

Drew McLellan 2638 points
Perch Support

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.