I cannot get this to work, I'm using the formit2db & db2formit snippets from the first post.
After submit, no data is going to the table and I'm getting the following errors in Modx error log:
[2015-08-06 19:07:54] (ERROR @ /index.php) [FormIt] Could not find hook "".
[2015-08-06 19:07:54] (ERROR @ /index.php) Could not load class: ModxCustomTransport4u from mysql.modxcustomtransport4u.
[2015-08-06 19:07:54] (ERROR @ /index.php) ModxCustomTransport4u::load() is not a valid static method.
[2015-08-06 19:07:54] (ERROR @ /index.php) Could not load class: ModxCustomTransport4u from mysql.modxcustomtransport4u.
This is the data I created the mysql table with:
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE IF NOT EXISTS `modx_custom_transport4u` (
`id` int(25) unsigned NOT NULL auto_increment,
`dname` varchar(225) NOT NULL default '',
`demail` varchar(20) NOT NULL default '',
`province` varchar(200) NOT NULL default '',
`country` varchar(200) NOT NULL default '',
`package` varchar(200) NOT NULL default '',
`method` varchar(200) NOT NULL default '',
`name4` varchar(200) NOT NULL default '',
`name2` varchar(200) NOT NULL default '',
`name1` varchar(200) NOT NULL default '',
`name3` varchar(200) NOT NULL default '',
`comment` LONGTEXT NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
This is my formit call:
[[!FormIt?
&hooks=`Formit2db,email`
&preHooks=`[[!profile]],db2Formit`
&prefix=`modx_custom_`
&packageName=`transport4u`
&tablename=`modx_custom_transport4u`
&emailFrom=`[email protected]`
&emailTpl=`myEmailChunk`
&emailTo=`[[+demail]]`
&emailCC=`[email protected]`
&emailSubject=`Your Delivery Request Quote`
&validate=`dname:required,
demail:required,
workmail:blank,
province:required,
datepicker:required,
country:required,
package:required,
method:required,
name4:required,
name2:required,
name1:required,
name3:required,
comment:required:stripTags`
This is the schema that is created in folders inside /core/components/ upon submit:
<?xml version="1.0" encoding="UTF-8"?>
<model package="transport4u" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
<object class="Transport4u" table="transport4u" extends="xPDOSimpleObject">
<field key="dname" dbtype="varchar" precision="225" phptype="string" null="false" default="" />
<field key="demail" dbtype="varchar" precision="20" phptype="string" null="false" default="" />
<field key="province" dbtype="varchar" precision="200" phptype="string" null="false" default="" />
<field key="country" dbtype="varchar" precision="200" phptype="string" null="false" default="" />
<field key="package" dbtype="varchar" precision="200" phptype="string" null="false" default="" />
<field key="method" dbtype="varchar" precision="200" phptype="string" null="false" default="" />
<field key="name4" dbtype="varchar" precision="200" phptype="string" null="false" default="" />
<field key="name2" dbtype="varchar" precision="200" phptype="string" null="false" default="" />
<field key="name1" dbtype="varchar" precision="200" phptype="string" null="false" default="" />
<field key="name3" dbtype="varchar" precision="200" phptype="string" null="false" default="" />
<field key="comment" dbtype="longtext" phptype="string" null="false" />
</object>
</model>
There is a difference between the class name generated in the schema to the 'class' in the Modx error log.
What do I have to change or adjust to make this work so the data saves to the mysql database?