Hi!
When I am trying to use the [id] placeholder in a condition for Users Ajax oder Entity drop-down (Ajax), the entire condition field gets ignored in the resulting SQL-query. It works perfectly fine when I replace [id] with any actual id number.
Similar to my previous issue (viewtopic.php?t=4273), i assume that this is not implemented? It is weird however that the entire condition field gets ignored as this is is different from the behavior in the previous thread.
As the [123] placeholders for fields are available in the Ajax field types, it is very unintuitive that [id], [parent_item_id] etc. are not. Am I doing something wrong or is this not implemented?
Thanks for your help!
Also (minor feature request): The Users Ajax field does not have a debug mode option
[id] not working in Ajax field type
- support
- Site Admin
- Posts: 6231
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: [id] not working in Ajax field type
Image is not available. Please create an example on personal demo https://www.rukovoditel.net/demo.php and send the link to the demo. I will look.
Re: [id] not working in Ajax field type
Sorry about that, here is the image.
´´´
e.id IN ( SELECT f.items_id FROM app_entity_1_values f WHERE f.fields_id = 271 AND f.value IN ( SELECT g.value FROM app_entity_26_values g WHERE g.fields_id = 272 AND g.items_id = [id]) )
´´´
With this configuration, it will only execute "select e.* from app_entity_1 e where e.id>0 order by e.id limit 0, 30"
As soon as I replace [id] with an example value, it executes the entire query
´´´
select e.* from app_entity_1 e where e.id>0 and (e.id IN ( SELECT f.items_id FROM app_entity_1_values f WHERE f.fields_id = 271 AND f.value IN ( SELECT g.value FROM app_entity_26_values g WHERE g.fields_id = 272 AND g.items_id = 8) )) order by e.id limit 0, 30
´´´
Let me know if you still need a demo.
I am trying to apply this condition to the field:´´´
e.id IN ( SELECT f.items_id FROM app_entity_1_values f WHERE f.fields_id = 271 AND f.value IN ( SELECT g.value FROM app_entity_26_values g WHERE g.fields_id = 272 AND g.items_id = [id]) )
´´´
With this configuration, it will only execute "select e.* from app_entity_1 e where e.id>0 order by e.id limit 0, 30"
As soon as I replace [id] with an example value, it executes the entire query
´´´
select e.* from app_entity_1 e where e.id>0 and (e.id IN ( SELECT f.items_id FROM app_entity_1_values f WHERE f.fields_id = 271 AND f.value IN ( SELECT g.value FROM app_entity_26_values g WHERE g.fields_id = 272 AND g.items_id = 8) )) order by e.id limit 0, 30
´´´
Let me know if you still need a demo.
- support
- Site Admin
- Posts: 6231
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: [id] not working in Ajax field type
Replace [id] to: e.id