Hi,
My form works perfectly with chronoform ( data are save in two tables)
I use Chronoconnectivity to make a list of selected records.
When I edit one record ( with the button {edit_record}, I get error
If I save data in one table only, It works perfectly.... But I need two tables
Help please
Regards
André
PS : there are no "-" in field name
My form works perfectly with chronoform ( data are save in two tables)
I use Chronoconnectivity to make a list of selected records.
When I edit one record ( with the button {edit_record}, I get error
Fatal error: Call to a member function bind() on a non-object in ....components/com_chronocontact/libraries/customcode.php(71) : eval()'d code on line 13
.If I save data in one table only, It works perfectly.... But I need two tables
Help please
Regards
André
PS : there are no "-" in field name
Hi André,
What's in the Autogenerated code box please? - the error is from line 13 of that.
Bob
What's in the Autogenerated code box please? - the error is from line 13 of that.
Bob
Hi Bob,
Thanks for your advice.
The code :
Thanks for your advice.
The code :
<?php
$MyForm =& CFChronoForm::getInstance("projetCG");
if($MyForm->formparams("dbconnection") == "Yes"){
$user = JFactory::getUser();
$row =& JTable::getInstance("chronoforms_evaluation", "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["jos_chronoforms_evaluation"] = $row;
}
?>
<?php
$MyForm =& CFChronoForm::getInstance("projetCG");
if($MyForm->formparams("dbconnection") == "Yes"){
$user = JFactory::getUser();
$row =& JTable::getInstance("chronoforms_projet", "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["jos_chronoforms_projet"] = $row;
}
?>
Hi André,
It looks as though ChronoForms hasn't saved details of the chronoforms_evaluation table in the database.
Open the DB Connection tab, set it to No and apply the form to save it. The re-open the tab, select both tables in the drop-down, re-set to Yes and Apply again; that should refresh the connection data.
Bob
It looks as though ChronoForms hasn't saved details of the chronoforms_evaluation table in the database.
Open the DB Connection tab, set it to No and apply the form to save it. The re-open the tab, select both tables in the drop-down, re-set to Yes and Apply again; that should refresh the connection data.
Bob
Hi Bob,
I did what you said, but the result is the same.
This form (where data are saved in two tables) works well from chronoform, but does not work when it is called by Chronoconnectivity.
What is wrong in Chronoconnectivity?
André
I did what you said, but the result is the same.
This form (where data are saved in two tables) works well from chronoform, but does not work when it is called by Chronoconnectivity.
What is wrong in Chronoconnectivity?
André
Hi André,
Specifically I don't know. There are several bits of ChronoConnectivity that don't work quite as well as they might. I'll look at the issue when I can - or hopefully Max will issue an improved version.
I just link directly to the ChronoForm using a custom url instead of using the {edit_record} syntax.
Bob
Specifically I don't know. There are several bits of ChronoConnectivity that don't work quite as well as they might. I'll look at the issue when I can - or hopefully Max will issue an improved version.
I just link directly to the ChronoForm using a custom url instead of using the {edit_record} syntax.
Bob
This topic is locked and no more replies can be posted.