• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: CGBetterForms problems
PostPosted: Wed Jun 12, 2019 6:17 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Aug 29, 2007 4:36 am
Posts: 246
Location: Sydney Australia
I'm having a few problems with CGBetterForms. I'm using the latest version 1.9.5. CMSms 2.2.10 & PHP 7.3

I can't save form results to a flat file. Everything in the templates gets replaced with HTML entities. Which causes an error message on the front end.

data-cgbf-extension - this data attribute gives me an error for every file format whether it's listed or not.

data-cgbf-accept - this data attribute gives me an error for every mime type except images.

Is it my hosting that's the problem?
Has anyone else got these working?

Cheers
Simon66


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms problems
PostPosted: Wed Jun 12, 2019 1:54 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8145
Location: Fernie British Columbia, Canada
data-cgbf-accept and data-cgbf-extensions are attributes applicable to inputs of type file are used to validate on the server side, the type of files that are uploaded.

data-cgbf-accept should be a comma separated list of mime type specifications (wildcards allowed). i.e: data-cgbf-accept="application/pdf, image/*"
if you don't know the mime type of a specific type of file you may have to look it up.

Hint: in some circumstances different computers (windows, mac, linux) can identify the same file with different mime types (it's all depending on which standard they listen to for that version of the OS). You need to know how your server identifies the file. Images are fairly standard in my experience, but CSV files from excel are not. and even PDF may not be.

data-cgbf-extensions should be a comma separated list of file extensions, i.e: data-cgbf-extensions="jpg jpeg png webp svg pdf"
it is not recommended to use file extensions as they are not even a reasonably reliable method of determining the type of a file.

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms problems
PostPosted: Wed Jun 12, 2019 11:35 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Wed Aug 29, 2007 4:36 am
Posts: 246
Location: Sydney Australia
Thanks CalGuy
I figured out the problem.
I had the {CGBetterForms form="Contact Form"} in the template instead of the content. So I switched 'Display form inline' to yes and 'Upload files asynchronously' to yes.

With data attributes I had copied the example from the module help:
Code:
data-cgbf-accept="image/*,application/*pdf"

After finding a bunch of mime types online I noticed the * before pdf. So I removed it and added more mime types.
This made it work properly.

Mime types:
Code:
application/pdf,
application/msword, (.doc)
application/vnd.openxmlformats-officedocument.wordprocessingml.document, (.docx)
application/vnd.oasis.opendocument.text (.odt)


I still can't save to Flat File though.
The document in the root is 'form_submissions.csv'
I don't change the template but I get an error on the front end.
Then I open the settings for 'save to Flat File' and the template looks like this:
Code:
{strip}
"{$myname|default:''}"
,"{$myemail|default:''}"
,"{$myphone|default:''}"
,"{$inputfile|default:''}"
,"{$message|default:''}"
{$EOL}{/strip}


Anyway, the form is working great without this.

Cheers
Simon66


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: CGBetterForms problems
PostPosted: Thu Jun 13, 2019 12:03 am 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 782
Location: Victoria, BC
Looks to be the same/similar as a know bug: http://dev.cmsmadesimple.org/bug/view/11855

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: bing


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
A2 Hosting