Ive read dozens of forum articles on this but it seems they are all written for v3, v4 and v5. I want to get the logged in user ID to return data from a separate table that isn't the users database. I dont want to mess with the Joomla User DB, so have a separate sheet.
I have the form already and collects data, profile_ph, profile_address, profile_emconph, profile_emconnm, and the usual other fields auto populated, and the chronoform auto captures the user id that completes the form to the user_id field.
I want the member to be able to click on the web link that they used to fill in the form, but with their data so they can edit it if they need to and then resave it.
I just can't get the user_id filtering bit working in chronoform V6. Ive tried the CC code from other posts:
<?php
$user = JFactory::getUser();
$form->data['user_id'] = $user->id;
?>
with this in the RD:
<?php
return array('id' => $form->data['user_id']);
?>
and all iterations of it, but with a Model name keeps coming up as the error, or some other error.
Im even happy to build it into CCv6, and can call the data in that already, but only for the individual by putting a filter into the 'Where Condition' for the DB Read, something like:
Profile.user_id:546
Basically filtering per user, but need it to read from the logged in user automatically and adjust that condition.
Even tried Profile.user_id:$user, obviously wrong, but don't know any better.
Thanks in Advance.
I have the form already and collects data, profile_ph, profile_address, profile_emconph, profile_emconnm, and the usual other fields auto populated, and the chronoform auto captures the user id that completes the form to the user_id field.
I want the member to be able to click on the web link that they used to fill in the form, but with their data so they can edit it if they need to and then resave it.
I just can't get the user_id filtering bit working in chronoform V6. Ive tried the CC code from other posts:
<?php
$user = JFactory::getUser();
$form->data['user_id'] = $user->id;
?>
with this in the RD:
<?php
return array('id' => $form->data['user_id']);
?>
and all iterations of it, but with a Model name keeps coming up as the error, or some other error.
Im even happy to build it into CCv6, and can call the data in that already, but only for the individual by putting a filter into the 'Where Condition' for the DB Read, something like:
Profile.user_id:546
Basically filtering per user, but need it to read from the logged in user automatically and adjust that condition.
Even tried Profile.user_id:$user, obviously wrong, but don't know any better.
Thanks in Advance.