Forums

db multi record loader empty

Irate 14 Sep, 2012
Hi,

I followed the document "CFV4_db_multi_record_loader". I have the list that appears but when I click on 'Edit', the form loads but empty.

<table>
<?php
foreach($form->data('UserDetails') as $detail):
?>
<tr>
<td>Nom:<?php echo $detail['nom']; ?></td>
<td><a href="index.php?option=com_chronoforms&chronoform=ASTEP&token=<?php echo $detail['cf_uid']; ?>">Edit</a></td>
</tr>
<?php
endforeach;
?>
</table>

Where is my mistake?
GreyHead 17 Sep, 2012
Hi Irate,

Do you have a DB Record Loader in the Edit form? What are the DB Field and Request Param box asettings?

Bob

PS Which tutorial document are you following?
Irate 17 Sep, 2012
Tutorial document : http://www.chronoengine.com/tutorials/v4-tutorials/164-cfv4dbmultirecordloader.html

I have a DB Record Loader in the Edit form [attachment=0]wizard.PNG[/attachment]

Basic
DB Field : none
Table : jos_chronoform_data_name of the table
Request Param : none
Mede ID : UserDetails
Fields : none

Advanced
Load data : yes
Data Load Type : All
Enable Associations : yes
JOIN Type : Inner
Group Model Data : yes

Data Displayer
Enable Data Displayer : yes
Enable Pagination :No
Limit: 50
GreyHead 24 Sep, 2012
Hi Irate,

I think you need to add at least one column name in the Display Fields box on the Data Displayer tab. It appears to work then with the rest of the settings the same as yours.

It looks as though Max wrote the tutorial before he added the Data Displayer tab to the action.

Bob
Irate 24 Sep, 2012
Thank you Bob.
If I add one column name in the Display Fields box on the Data tab Displayer, my table is not in the form.

first picture

[attachment=1]Capture1.PNG[/attachment]

If I click "Edit"

Form is empty

[attachment=0]Capture2.PNG[/attachment]

Irate
GreyHead 25 Sep, 2012
Hi Irate,

I think that the problem here is that you now have two listings. One from the Data Displayer and the second from your earlier HTML+PHP code.

I'm not sure why the Edit links aren't working. What do the URLs look like? Is there a record identifier included? Does the edit form have a DB Record Loader to load the specified record.

Bob
Irate 27 Sep, 2012
Hi Bob,

in urls, I get
/index.php?option=com_chronoforms&chronoform=ASTEP&token=4d0bad071851a7.....
.
This corresponds to
$detail['cf_uid']
of my php/html code, but the form that appears only retrieves the information and remains empty.
Do you see any other solution to get a table in the form to edit then ?

Irate
GreyHead 27 Sep, 2012
Hi Irate,

I'm not too familiar with the workings of the latest version of ChronoConnectivity but that token value looks odd. I would have expected something other than a random string there.

Bob
Did 21 Mar, 2013
Hello,

I have the same problem, I have been looking for hours on Formus, and I can not find a solution.
I followed the tutorial on the site, and when I click EDIT, my fields are empty.
did you find solution.

ps: sorry for my english I speak French
GreyHead 22 Mar, 2013
Hi Did,

Sorry but I can't give you a helpful answer from the little information you have posted here. What do you see if you turn ChronoConnectivity Debug on?

Bob
Did 22 Mar, 2013
Hello Bob,

thank you for your help

This my code
<table>
<?php
foreach($form->data('UserDetails') as $detail):
?>
<tr>
<td>Nom:<?php echo $detail['profession']; ?></td>
<td><a href="index.php?option=com_chronoforms&chronoform=user_detail&token=<?php echo $detail['cf_uid']; ?>">Edit</a></td>
</tr>
<?php
endforeach;
?>
</table>


When i use Debugger i have this.


Ipc Clientèle
Nom:developer 	Edit
Nom:developer 	Edit
Nom:developer 	Edit
Data Array: 

Array
(
    [option] => com_chronoforms
    [chronoform] => liste_datas
    [UserDetails] => Array
        (
            [0] => Array
                (
                    [cf_id] => 1
                    [cf_uid] => d3fc534230788fc9ed3cb827333aef74
                    [cf_created] => 2013-03-21 19:49:13
                    [cf_modified] => 0000-00-00 00:00:00
                    [cf_created_by] => 0
                    [cf_modified_by] => 0
                    [cf_ipaddress] => 91.180.204.155
                    [cf_user_id] => 0
                    [profession] => developer
                    [subscribed] => 0
                    [phone] => 12345789
                    [input_submit_4] => Submit
                )

            [1] => Array
                (
                    [cf_id] => 2
                    [cf_uid] => bd80e26e9ba42302bfc4924443089bb8
                    [cf_created] => 2013-03-21 20:32:16
                    [cf_modified] => 0000-00-00 00:00:00
                    [cf_created_by] => 0
                    [cf_modified_by] => 0
                    [cf_ipaddress] => 91.180.204.155
                    [cf_user_id] => 0
                    [profession] => developer
                    [subscribed] => 0
                    [phone] => 12867664184
                    [input_submit_4] => Submit
                )

            [2] => Array
                (
                    [cf_id] => 3
                    [cf_uid] => 981c95007723831569be5baae9f991d3
                    [cf_created] => 2013-03-21 20:42:23
                    [cf_modified] => 0000-00-00 00:00:00
                    [cf_created_by] => 0
                    [cf_modified_by] => 0
                    [cf_ipaddress] => 91.180.204.155
                    [cf_user_id] => 0
                    [profession] => developer
                    [subscribed] => 0
                    [phone] => 
                    [input_submit_4] => Submit
                )

        )

)

Validation Errors:

Array
(
)


I followed the document "CFV4_db_multi_record_loader". I have the list that appears but when I click on 'Edit', the form loads but empty.
Did 22 Mar, 2013
Bob, I have this too

Debug Data

db_multi_record_loader
SELECT `UserDetails`.* FROM `j3wkg_chronoforms_data_user_detail` AS `UserDetails` LIMIT 0,50

Powered By ChronoForms - ChronoEngine.com
GreyHead 23 Mar, 2013
Hi Did,

I can see that this line:
foreach($form->data('UserDetails') as $detail):
needs [] instead of ():
foreach($form->data['UserDetails'] as $detail):

Does that solve it?

Bob
Did 23 Mar, 2013
Hi Bob,

I try with your correct code but the result is the same😟
Did 23 Mar, 2013
my new code
<table>
<?php
    foreach($form->data['UserDetails'] as $detail):
?>
<tr>
<td>Nom:<?php echo $detail['profession']; ?></td>
<td><a href="index.php?option=com_chronoforms&chronoform=user_detail&token=<?php echo $detail['cf_uid']; ?>">Edit</a></td>
</tr>
<?php
endforeach;
?>
</table>
GreyHead 23 Mar, 2013
Hi Did,

Does that give you a URL with a token value set?

Bob
Did 23 Mar, 2013
Hi Bob,

When I changed 'cf_uid' by anything,in "<td><a href="index.php?option=com_chronoforms&chronoform=user_details&token=<?php echo $detail ['cf_uid'] ; ?>">Edit</a></td>", the result is the same.
I think it does not load CF_uid.
I do not understand why?
I know nothing about PHP.
Did 25 Mar, 2013
Hi Bob,

Have you a solution for me please?
I can not find.

Thank's

Did
Did 25 Mar, 2013
when i use only DB Record Loader i have this message:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 SQL=SELECT * FROM `j3wkg_chronoforms_data_user_details` AS `J3wkgChronoformsDataUserDetails` WHERE
Did 25 Mar, 2013
Bob,

after many hours of searching, I finally found my mistake
the problem was in the FORM user_details -> Load Under Model ID -> it must be on "No" and not "Yes".

Now it's good🙂

thank'you for all

Did
rkamouni 09 Apr, 2013
I followed the document "CFV4_db_multi_record_loader". I have the list that appears but when I click on 'Edit', the form loads but empty.

before 'Edit' is clicked
[attachment=1]before.png[/attachment]

After 'Edit' is clicked
[attachment=0]after.png[/attachment]
GreyHead 09 Apr, 2013
Hi rkamouni,

Do you have a DB Record Loader in the form On Load event? If so, what settings are you using there?

Bob
rkamouni 09 Apr, 2013
Hi Bob,
I haven't a "DB Record Loader" because i want to use "DB Multi Record Loader". Is it necessary to have "DB Record Loader" for that?

Thank you in advance
GreyHead 09 Apr, 2013
Hi rkamouni,

I'm not sure, I rarely use the automatic edit links because I prefer the control I get by adding my own. If ChronoConnectivity loads the data to be edited for you that's great

Bob
This topic is locked and no more replies can be posted.