So I had CFV5 mastered for what I need it for, then comes along CFv6.
For CFV5, I use the following to read my user data from Easy Profile. I use Easy Profile to create all custom fields I want, and my chronoforms reads all data (text fields, radioboxes, dates, etc...)
(The only thing I want to do here is have CF6 read the user_id, username, email, firstname, and lastname. If I can get these items to read into a CF6 form, all my extra fields should be a piece of cake.)
My CF5 worked perfectly to read jsn_user (Easy Profile) data table
CFV5 ON LOAD
CF5 Custom Code1 [Note this is from the documentation at Easy Profile which is required to access their data]
<?php
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
?>
CF5 Custom Code 2
<?php
$user = \JFactory::getUser();
$user=JsnHelper::getUser();
$form->data['user_id'] = $user->id;
$form->data['lastname'] = $user->lastname;
?>
CF5 DB Read
table name "jsn_users" [this is the Easy Profile user table]
multiread is "no"
enable model id is "no"
Model id is "blank"
Conditions Box
<?php
$user = JFactory::getUser();
return array("user_id" => $user->get("id"));
?>
CF5 Custom Code 3
<?php
$user = \JFactory::getUser();
$user=JsnHelper::getUser();
$form->data['username'] = $user->username;
$form->data['user_id'] = $user->id;
$form->data['email'] = $user->email;
$form->data['firstname'] = $user->firstname;
$form->data['lastname'] = $user->lastname;
?>
I also have a CF5 handle arrays on load to convert arrays back into the form (i.e., radio, checkbox, etc...)
All of the above will read the data into my CF5 form with all those fields present in the Designer and in the Data Table for this form.
************
Now, for CF6, I have tried a bunch of things to read my easy profile data.
First, if I put this
<?php
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
?>
then I get this message when the form Loads: Parse error: syntax error, unexpected '<' in /home/*/public_html/libraries/cegcore2/admin/extensions/chronofc/functions/php/php_output.php(6) : eval()'d code on line 1
Second, I cannot add this
<?php
$user = \JFactory::getUser();$user=JsnHelper::getUser();
$form->data['user_id'] = $user->id;
$form->data['lastname'] = $user->lastname;
?>
because $form->data in CF5 is now $this->data in CF6 (I tried chaning "form" to "this" without success)
Third, when I get to the DB Read (black label is "read_data13" and in CF6, it appears as though ModelID (which is named "data13") is mandatory.
I tried to add some Where Conditions
Data13.id:{data:id} then I tried
Data13.user_id:{data:id} then I tried
Data13.id:{data:user_id}
all with no luck.
I also tried to add some Fields to Retrieve
{var.read_data13.Data13.id}
{var.read_data13.Data13.username}
{var.read_data13.Data13.email}
{var.read_data13.Data13.firstname}
with no luck and the CF6 form doesnt load.
************
Hopefully CF6 can DB Read the jsn_users table like CF5.
Then I will turn my attention to DB save back to the jsn_users table which I had a special php code to accomplish on a field by field basis for any CF5 form.
For CFV5, I use the following to read my user data from Easy Profile. I use Easy Profile to create all custom fields I want, and my chronoforms reads all data (text fields, radioboxes, dates, etc...)
(The only thing I want to do here is have CF6 read the user_id, username, email, firstname, and lastname. If I can get these items to read into a CF6 form, all my extra fields should be a piece of cake.)
My CF5 worked perfectly to read jsn_user (Easy Profile) data table
CFV5 ON LOAD
CF5 Custom Code1 [Note this is from the documentation at Easy Profile which is required to access their data]
<?php
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
?>
CF5 Custom Code 2
<?php
$user = \JFactory::getUser();
$user=JsnHelper::getUser();
$form->data['user_id'] = $user->id;
$form->data['lastname'] = $user->lastname;
?>
CF5 DB Read
table name "jsn_users" [this is the Easy Profile user table]
multiread is "no"
enable model id is "no"
Model id is "blank"
Conditions Box
<?php
$user = JFactory::getUser();
return array("user_id" => $user->get("id"));
?>
CF5 Custom Code 3
<?php
$user = \JFactory::getUser();
$user=JsnHelper::getUser();
$form->data['username'] = $user->username;
$form->data['user_id'] = $user->id;
$form->data['email'] = $user->email;
$form->data['firstname'] = $user->firstname;
$form->data['lastname'] = $user->lastname;
?>
I also have a CF5 handle arrays on load to convert arrays back into the form (i.e., radio, checkbox, etc...)
All of the above will read the data into my CF5 form with all those fields present in the Designer and in the Data Table for this form.
************
Now, for CF6, I have tried a bunch of things to read my easy profile data.
First, if I put this
<?php
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
?>
then I get this message when the form Loads: Parse error: syntax error, unexpected '<' in /home/*/public_html/libraries/cegcore2/admin/extensions/chronofc/functions/php/php_output.php(6) : eval()'d code on line 1
Second, I cannot add this
<?php
$user = \JFactory::getUser();$user=JsnHelper::getUser();
$form->data['user_id'] = $user->id;
$form->data['lastname'] = $user->lastname;
?>
because $form->data in CF5 is now $this->data in CF6 (I tried chaning "form" to "this" without success)
Third, when I get to the DB Read (black label is "read_data13" and in CF6, it appears as though ModelID (which is named "data13") is mandatory.
I tried to add some Where Conditions
Data13.id:{data:id} then I tried
Data13.user_id:{data:id} then I tried
Data13.id:{data:user_id}
all with no luck.
I also tried to add some Fields to Retrieve
{var.read_data13.Data13.id}
{var.read_data13.Data13.username}
{var.read_data13.Data13.email}
{var.read_data13.Data13.firstname}
with no luck and the CF6 form doesnt load.
************
Hopefully CF6 can DB Read the jsn_users table like CF5.
Then I will turn my attention to DB save back to the jsn_users table which I had a special php code to accomplish on a field by field basis for any CF5 form.