Hello,
I am trying to allow my registered/logged in users to view and edit their career profiles (each user only gets to save one career profile) that they have previously saved in a table using a V5 form. This worked perfectly in V4 using a hidden field (cf_id) and this WHERE statement:
Alas, I can't figure out how to pull/edit/save existing records in V5. I have fiddled with this FAQ below but still no luck.
https://www.chronoengine.com/faqs/72-ccv5/5215-how-do-i-build-a-where-statement-in-ccv5.html
Any assistance would be a life saver!
Here is the order of things:
DESIGNER:
HIDDEN FIELD (with cf_id)
SETUP:
1. DB READ
[list]Multi Read=Yes
Enable Model ID=No
Model ID= empty
Fields=cf_id
Order=empty
Group=empty
Conditions=tried several things, currently blank[/list]
2. HTML RENDER
3. DEBUGGER
Here are the latest debugger results...
Any assistance would be sincerely appreciated!
I am trying to allow my registered/logged in users to view and edit their career profiles (each user only gets to save one career profile) that they have previously saved in a table using a V5 form. This worked perfectly in V4 using a hidden field (cf_id) and this WHERE statement:
<?php $user =& JFactory::getUser();
$form->data['user_id'] = $user->id;?>
Alas, I can't figure out how to pull/edit/save existing records in V5. I have fiddled with this FAQ below but still no luck.
https://www.chronoengine.com/faqs/72-ccv5/5215-how-do-i-build-a-where-statement-in-ccv5.html
Any assistance would be a life saver!
Here is the order of things:
DESIGNER:
HIDDEN FIELD (with cf_id)
SETUP:
1. DB READ
[list]Multi Read=Yes
Enable Model ID=No
Model ID= empty
Fields=cf_id
Order=empty
Group=empty
Conditions=tried several things, currently blank[/list]
2. HTML RENDER
3. DEBUGGER
Here are the latest debugger results...
Data Array
Array
(
[id] => 89
[careerprofilebuild] =>
[0] => Array
(
[cf_id] => 79
)
)
Array
(
)
Errors
Array
(
)
Debug Info
Array
(
[2] => Array
(
[DB Read] => Array
(
[Queries] => Array
(
[0] => SELECT `Data`.`cf_id` AS `Data.cf_id` FROM `j16_chronoforms_data_careerprofile` AS `Data`
)
)
)
)
Any assistance would be sincerely appreciated!
Hi swmckay,
Please try this in the Conditions box:
Bob
Please try this in the Conditions box:
<?php
$user = JFactory::getUser();
return array( 'user_id' => $user->id);
?>
Bob
Hi Bob,
I added in the code below in DB Read/Conditions. It did not call the existing record as it should. In fact instead if updating the record it added a second one. Here is the code I added and the debugger results. Not sure what the results mean. Any ideas on how to fix it?
I added in the code below in DB Read/Conditions. It did not call the existing record as it should. In fact instead if updating the record it added a second one. Here is the code I added and the debugger results. Not sure what the results mean. Any ideas on how to fix it?
<?php
$user = JFactory::getUser();
?>
return array( 'user_id' => $user->id);
?>
return array( 'user_id' => $user->id); ?>
Data Array
Array
(
[id] => 89
[careerprofilebuild] =>
[0] => Array
(
[cf_id] => 79
)
)
Array
(
)
Errors
Array
(
)
Debug Info
Array
(
[2] => Array
(
[DB Read] => Array
(
[Queries] => Array
(
[0] => SELECT `Data`.`cf_id` AS `Data.cf_id` FROM `j16_chronoforms_data_careerprofile` AS `Data`
)
)
)
)
This topic is locked and no more replies can be posted.