Read data with relation = Multiple matching records

How to fix SQL syntax errors when using multiple matching records relation in ChronoForms v7.

Overview

The problem is a bug in CF v7 that causes SQL syntax errors when configuring a "multiple matching records" relation between tables, which worked correctly in CF v6.
Wait for the official CF v7 update that includes the fix, or contact support to obtain a patch file in the interim.

Answered
ChronoForms v7
Fl FloB 23 Jan, 2021
Hello,

I try to connect 2 tables with the multiple matching records relation, but there's someting I do wrong because I've got "an error in my SQL syntax near 'FROM `#__contentitem_tag_map` AS `map` WHERE `map`.`content_item_id` IN ('1', '"

It was working fine on CF v6, but I can't reproduce it on CF v7.
I think I missed something.
I join the 2 backups (v6 and v7).

Does anyone know how to do this sort of relation between to tables ?

Florence
Fl FloB 23 Jan, 2021
With the backups🙂
​[file=13710]TestReadData_23_Jan_2021_22_04_59.cf6bak[/file]
​[file=13712]TestReadData_23_Jan_2021_22_04_35.cf7bak[/file]
Max_admin Max_admin 06 Feb, 2021
does it work when you chnge the relation type to "one matching record, fkey in this model" ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Fl FloB 08 Feb, 2021
Hello Max,

Yes, it does work when the relation type is "one matching record, foreign key in this model".
Here the result in the debug with this type of relation :
[var] => Array
                (
                    [0] => Array
                        (
                            [contact] => Array
                                (
                                    [id] => 70
                                 )

                            [map] => Array
                                (
[content_item_id] => 70
[tag_id] => 2 ) ) [1] => Array ( [contact] => Array ( [id] => 70 ) [map] => Array (
[content_item_id] => 70 [tag_id] => 4 ) )

What I need is this result :
[var] => Array
                (
                    [0] => Array
                        (
                            [contact] => Array
                                (
                                    [id] => 70
                                 )

                            [map] => Array
                                (
[0] => Array
(
[content_item_id] => 70 [tag_id] => 2 )
[1] => Array
(
[content_item_id] => 70
[tag_id] => 4
) ) )

It was working on CFv6 with the "multiple matching records" relation, but with CFv7, I've got an error.
Maybe it is the syntax in the "equation" that is not correct.
I have tried with :
map.content_item_id = contact.id (field)
map.content_item_id IN contact.id (field)
map.content_item_id = contact.id (value)
map.content_item_id IN contact.id (value)
But I've got the same error (the one in the first message) with all syntaxes.
Max_admin Max_admin 10 Feb, 2021
Answer
1 Likes
There is a bug, if you can not wait for the next official update then you may send me a message using the contact page to get a patch file!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Fl FloB 10 Feb, 2021
Thanks !
I will wait the official update.
This topic is locked and no more replies can be posted.