Forums

no DB records

arrowsvienna 10 Dec, 2009
Hi,

I have latest chronoforms installed, made a new form, created a table (as in tutorial), connected the table to the form (db connection),but
there is no data saved!
maybe it has something to do with the email function, because I have no email configured. But this should not be a problem, I have set the settings "save data before email" enabled.
There is no error message, I even see the submit message I have created, but the data is simply not stored in the table. The table exist, I have checked it with phpmyadmin.

Please help me!
GreyHead 10 Dec, 2009
Hi arrowsvienna,

Change the setting back to the default "save data after email". If you don't have email enabled then the before email actions are disabled (both data saving and the OnSubmit Before code box). It's just an odd quirk of ChronoForms.

Bob
arrowsvienna 11 Dec, 2009
It works, thank you very much.
although it is not logical at all😉
tamarteleco 15 Dec, 2009
Hi,
CF doesn't save the records in the DDBB. It was sending email correctly. Then I created the table, table conecction etc. When I submit the form everthing seems to work fine, but when I browse the DDBB by phpmyadmin of by Joomla admin interface, the table is empty.
The debub log doesn't help, or I can't find anything wrong.
Could you tell me what and where I have to verify to see it works correctly?
This is my debug log:
1. Form passed first SPAM check OK
2. Form passed the submissions limit (if enabled) OK
3. Form passed the Image verification (if enabled) OK
4. Form passed the server side validation (if enabled) OK
5. $_POST Array: Array ( [form_requestor] => My_name [form_combo_department] => Finance [form_combo_importance] => High [form_text_improvement] => Lorem ipsume klajdfaklñjdfklajdklj [form_text_future_situation] => kljñkljkldjklajklñjad [form_text_affected] => lkjdklñafjdaklñjfdaklñjkl [form_text_process_affected] => dafjakldjfklajkl [form_text_tools_affected] => adfadfadsfakldjfklajklñsdj [button_16] => Send improvement idea [8ce65e1259d24d6af6865a009df01240] => 1 [1cf1] => 1c05d2b3405be6f54b2bf5c66cea21f5 [chronoformname] => improvementidea_form )
6. $_FILES Array: Array ( [form_file_upload] => Array ( [name] => com_jce_157_154_package.zip [type] => application/octet-stream [tmp_name] => C:\WINDOWS\Temp\phpC1.tmp [error] => 0 [size] => 770881 ) )
7. Upload routine started for file upload by : form_file_upload
8. C:\xampp\htdocs\bcc\forms\files\20091215190001_com_jce_157_154_package.zip has been uploaded OK
9. Form passed the plugins step (if enabled) OK
GreyHead 15 Dec, 2009
Hi tamarteleco,

There's nothing in the ChronoForms debug that helps diagnose the Database save (perhaps there should be).

Try turning on Site Debug in the Site Global Configuration settings, submit the form and search for the MySQL to see what is actually being run.

Bob
tamarteleco 16 Dec, 2009
Hi Bob,
Thanks for your reply.
I activeted the debug in Joomla system, but still can't get what is wrong.
The debug display info is a list of queries and not to much else.
I tried my mail.php function to test if mail is working, and effectively it does. With the form of CF now it doesn't send mail and doesn't record the fields in the DDBB.
If it is usefull for you, I can send you the debug info, but I think is worth less because they're queries and not to much more.

What can I do?
I need it to work soon.
Any help of how I could find why It doesnt record the data?

Thanks.
GreyHead 16 Dec, 2009
Hi tamarteleco,

ChronoForms uses a database query to save the data to the database.

Find the query from the Debug information and then look to see why it isn't working.

Pasting the query into PHPMyAdmin may give you some clues.

From the ChronoForms debug information you posted it looks as though the Emails aren't enabled - or there is an error in the form submission before the email is sent.

Bob
tamarteleco 16 Dec, 2009
Hi Bob,
Thanks for your reply.
I can't see any 'UPDATE' query in the debug info related to the table I've created to save the data.
I paste you here the last queries. Sorry for the long text.
Do you think the query for updating is failing somewhere?

Thanks!
***************************************
6.
SELECT folder AS type, element AS name, params
FROM bcc_plugins
WHERE published >= 1
AND access <= 0
ORDER BY ordering
7.
SELECT m.*, c.`option` AS component
FROM bcc_menu AS m
LEFT JOIN bcc_components AS c
ON m.componentid = c.id
WHERE m.published = 1
ORDER BY m.sublevel, m.parent, m.ordering
8.
SELECT *
FROM `bcc_chrono_contact`
WHERE `name` = 'improvementidea_form'
9.
SELECT *
FROM `bcc_chrono_contact`
WHERE `name` = 'improvementidea_form'
10.
SELECT *
FROM `bcc_chrono_contact_emails`
WHERE `formid` = '4'
ORDER BY emailid
11.
SELECT *
FROM `bcc_chrono_contact`
WHERE `id` = '4'
12.
SELECT *
FROM `bcc_chrono_contact`
WHERE `id` = '4'
13.
SELECT *
FROM `bcc_chrono_contact_plugins`
WHERE `form_id` = '4'
AND event IN ('ONSUBMIT','ONLOADONSUBMIT')
AND `name` = 'cf_confirmation_page'
14.
SELECT template
FROM bcc_templates_menu
WHERE client_id = 0
AND (menuid = 0 OR menuid = 5)
ORDER BY menuid DESC
LIMIT 0, 1
15.
SELECT id, title, module, position, content, showtitle, control, params
FROM bcc_modules AS m
LEFT JOIN bcc_modules_menu AS mm
ON mm.moduleid = m.id
WHERE m.published = 1
AND m.access <= 0
AND m.client_id = 0
AND ( mm.menuid = 5 OR mm.menuid = 0 )
ORDER BY position, ordering

Language Files Loaded

* C:\qmd\www\bcc\language\en-GB\en-GB.ini 1
* C:\qmd\www\bcc\language\en-GB\en-GB.plg_system_debug.ini 1
* C:\qmd\www\bcc\administrator\language\en-GB\en-GB.plg_system_cdscriptegrator.ini 1
* C:\qmd\www\bcc\language\en-GB\en-GB.com_chronocontact.ini
* C:\qmd\www\bcc\language\en-GB\en-GB.tpl_template_bcc.ini
* C:\qmd\www\bcc\language\en-GB\en-GB.mod_mainmenu.ini 1

Untranslated Strings Diagnostic

None

Untranslated Strings Designer

***************************************
tamarteleco 16 Dec, 2009
Hi Bob,
I've created a new simple form. With its table. Table connect to DB ...etc.
And this one doesnt work as well.
I don't know how I could get where it fails.
Do you have any idea?

Thanks!
tamarteleco 16 Dec, 2009
This is the autogenerated code of the simple form if it helps:
*****************************************************************
<?php
$MyForm =& CFChronoForm::getInstance("basicDemo");
if($MyForm->formparams("dbconnection") == "Yes"){
$user = JFactory::getUser();
$row =& JTable::getInstance("chronoforms_basicdemo", "Table");
srand((double)microtime()*10000);
$inum = "I" . substr(base64_encode(md5(rand())), 0, 16).md5(uniqid(mt_rand(), true));
JRequest::setVar( "recordtime", JRequest::getVar( "recordtime", date("Y-m-d")." - ".date("H:i:s"), "post", "string", "" ));
JRequest::setVar( "ipaddress", JRequest::getVar( "ipaddress", $_SERVER["REMOTE_ADDR"], "post", "string", "" ));
JRequest::setVar( "uid", JRequest::getVar( "uid", $inum, "post", "string", "" ));
JRequest::setVar( "cf_user_id", JRequest::getVar( "cf_user_id", $user->id, "post", "int", "" ));
$post = JRequest::get( "post" , JREQUEST_ALLOWRAW );
if (!$row->bind( $post )) {
JError::raiseWarning(100, $row->getError());
}
if (!$row->store()) {
JError::raiseWarning(100, $row->getError());
}
$MyForm->tablerow["bcc_chronoforms_basicdemo"] = $row;
}
?>
*****************************************************************
GreyHead 16 Dec, 2009
Hi tamartelco,

I can see from the ChronoForms code that the tablename is 'chronoforms_basicdemo' but in the site debug this table isn't mentioned (and there is no INSERT or UPDATE query).

So my guess is that the DB Connection isn't correctly set. Please try setting it to 'No'; saving the form then set it back to 'Yes' and save again.

If this doesn't work then by all means email or PM me the site URL and a SuperAdmin login and I'll take a look.

Best wishes

Bob
tamarteleco 16 Dec, 2009
Hi Bob,

I think, I tried already this.
I did in ChronoFoms, then I clicked on my form name, then DB connection TAB, then "Enable Data storage:yes". Here I change to "No". Then save, and later to "yes".
Is here where you mean? Or in other place in Joomla?.
If it is here it doesn't work.

Can I send you a joomlaPack ".jpa" file (aroun 10mb) so you can install my site and test it? My site is inside an intranet network and is not reacheable by outside.

Thanks!
GreyHead 16 Dec, 2009
Hi tamarteleco,

[sendfb][/sendfb]
Bob
tamarteleco 16 Dec, 2009
HI Bob,
Thanks.
I zip the backup file, hope you can find something.

Kind regards.
nml375 16 Dec, 2009
Hi tamarteleco,
From what I can see, the dbclasses entry (which is responsible for creating the proper JTable class used in the autogenerated code) uses the database table 'bcc_banner', which seems to match the standard #__banner Joomla table.

However, the form field names does not match any of the fields in this table. Have you doublechecked that you selected the right database table in the DB Storage tab?

/Fredrik
GreyHead 16 Dec, 2009
Hi tamarteleco,

The DB Connection is to the bcc_banner table but, as far as I can see, none of your form inputs have names that match the columns in bcc_banner.

Bob
tamarteleco 16 Dec, 2009
Hi Fredrik,
Thanks for your replay,
Yes it was selected the banner table. May be it changed when I turned on and off the db connection.
I have change it to the corresponding table, and still not work.
I attach the backup.
Could you see anything?

Thanks a lot!
nml375 16 Dec, 2009
Hi,
Next then, does the email delivery work properly?
(if not, have you enabled email on the General tab)

/Fredrik
GreyHead 16 Dec, 2009
Hi tamarteleco,

I used Create Table to create a table, set the DB Connection to point to it, and the form data saves OK.

You have the DB Connection set to before Email which means it will not run if you turn email OFF in the General tab but it appears to be set to ON.

Bob
tamarteleco 16 Dec, 2009
Thanks for your responses.
Before creating the table and assign the table etc the mail was working. Since then is not delivering.
The mail works fine outside Joomla, with a simple php mail script works:
***********************************************
<?php
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: postmaster@my_server.com' . "\r\n";
mail("chelpot@gmail.com","testing"," Sent from my server",$headers);
echo "Mail Sent.";
?>
***********************************************

An the table created is:
CREATE TABLE IF NOT EXISTS `bcc_chronoforms_improvementidea_form` (
`cf_id` int(11) NOT NULL AUTO_INCREMENT,
`uid` varchar(255) NOT NULL,
`recordtime` varchar(255) NOT NULL,
`ipaddress` varchar(255) NOT NULL,
`cf_user_id` varchar(255) NOT NULL,
`form_requestor` text NOT NULL,
`form_text_improvement` text NOT NULL,
`form_text_future_situation` text NOT NULL,
`form_text_affected` text NOT NULL,
`form_text_process_affected` text NOT NULL,
`form_text_tools_affected` text NOT NULL,
`form_combo_department` varchar(255) NOT NULL,
`form_combo_importance` varchar(255) NOT NULL,
PRIMARY KEY (`cf_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

So, my configuration is fine?
GreyHead 16 Dec, 2009
Hi tamarteleco,

Please change the "Saving Data/Emails order:" on the DB Connection tab to 'After Emails' and see if that makes a difference.

Bob
tamarteleco 16 Dec, 2009
Hi Bob,

I changed it. But still doesn't work.

Can I test a new form without email to see if at least DDBB records works?

Or, what would you do?
tamarteleco 16 Dec, 2009
Hi Bob,

I created a simple form without email, just to record in the DDBB but doesn't record any data as well.
I don't know where to see.
Do you know why is failing?

Thanks!
nml375 16 Dec, 2009
Hi,
From what I can read of the form backup, you've enabled quite a bunch of plugins, including cf_confirmation_page, cf_email_verification, cf_multi_page and cf_recaptcha - each stopping chronoforms early (prior db save and/or email) under certain conditions. My guess is that it's one of all those plugins causing the issue - especially if the plugin(s) is(are) not configured or intended to be used.

/Fredrik
tamarteleco 16 Dec, 2009
Thanks F.
I tested the mail with the mail icon in the front end of joomla, and it works.
I gonna disable the plugins you said. As you said, I'm only using confirmation page. But I wasn't sure if Green were desable it, or not because the cross icon. So I'll let in green the only one I'm using that is Confirmation page.

I gonna test if it works.
GreyHead 16 Dec, 2009
Hi tamarteleco,

Following up on Fredrik's post.

The plugins list in your form shows an 'English Email Template' Plugin that I don't remember seeing before.

What's that?

Please turn off the Confirmation Page plugin as well.

Bob
tamarteleco 16 Dec, 2009
Hi Bob,

I have tested letting only the confirmation page and it doesn't. I gonna test now disabling all of them and I let you know.

Thanks!
tamarteleco 16 Dec, 2009
It Works!!!!

It has record in the DDBB.

So is a problem of my setting with the confirmation page plugin? I need it as well.

Thanks!
tamarteleco 16 Dec, 2009
Hi,

I see that now that the plugins are desable, the text from emails template TAB appear. I should let this empty?
on my email template:
***************************
Fill in the following fields. Your idea will be studied following the C.00.03 Evaluate Improvement idea
Change requestor name:
{form_requestor}
Department:
{form_combo_department}
Business importance
{form_combo_importance}
Description of the improvement:
{form_text_improvement}

{form_text_future_situation}
Stakeholders / Departments / Users affected
{form_text_affected}
Processes affected
{form_text_process_affected}
Supporting documentation
{form_file_upload}
IT tools affected
{form_text_tools_affected}

Thanks!
***************************

Should I let this tab empty if I will use confirmation page plugin?

Thanks.
nml375 16 Dec, 2009
Hi,
The confirmation plugin has it's own setup (per form, check the checkbox for the form in question and then click on the Confirmation plugin in the list to the left).

There, you'll need to create a template to display the submitted data for confirmation - pretty much like you do with your email templates. Also remember to either add the proper submit-button (name="confirm" value="Submit"), or tell the plugin to add them by selecting "yes" on "Show submit and back buttons".
Emails and DB storage will not be done until the visitor clicks the Submit button on the second page (confirmation page).

/Fredrik
tamarteleco 16 Dec, 2009
Hi Fredik,
Thanks for your response.

I had already the plugin configured on the left side. I will put down the code. What I didn't see was the submit button that you mention in the front-end. I let it as it was in the back-end. You can see the photo attached.

So, until I don't set up properly the button of the plugin and the user press it, it wont record the data and it wont send the mail?

Now the mail is working fine the the plugin desactived.

Thanks again.
nml375 16 Dec, 2009
Hi,
Precisely, the plugin is used so that the user may preview his or her submission before actually sending it, possibly going back to the form in order to correct any mistakes before completing the submission.

If you only want a thankyou-page, just use the "On Submit - after email".

/Fredrik
tamarteleco 16 Dec, 2009
Thans Bob and Fredik,
I wont use the plugin and I will use the Mail template tab instead.
Thanks for your fast help!!!!!
And for develop this component!
This topic is locked and no more replies can be posted.