Buy Now
Sign in

Read data with relation = Multiple matching records

FloB , January 23 2021, 21:08
F
FloB 215
January 23 2021, 21:08 #395742
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
F
FloB 215
January 23 2021, 21:10 #395743
admin 32
February 06 2021, 22:06 #395877
does it work when you chnge the relation type to "one matching record, fkey in this model" ?
F
FloB 215
February 08 2021, 12:33 #395887
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.
admin 32
February 10 2021, 14:11 #395915
 1
 Answer
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!
F
FloB 215
February 10 2021, 14:34 #395917
Thanks !
I will wait the official update.