Add additional join condition to list query using php-event plugin

I ran into an issue while defining a join involving multiple join conditions and looking for help.

The "joins" tab in the lists allows us to define single join condition.
I have a need to add an additional join condition as explained below.
Table A with columns a,b,c and table B with columns a,b,d
So in defining the join I provided the condition as A.a = B.a
But I also need to define the additional condition as A.b = B.b

I added the below condition in php-events OnBuildQueryWhere:
$model->setPluginQueryWhere('exqual', "A.b = B.b");

On passing the fabrikdebug=1 URL parameter it shows that this condition is added in the "getJoinMergeTotalRecords" query but not in the "GetData" query.

How/where should I specify this so it works as expected?
 
I have this problem too.
My where condition is:
PHP:
$model->setPluginQueryWhere('exqual', "table_name.end_date > NOW() - INTERVAL 30 DAY");
The code added in table:mergeJoinedData get ids, but not added in list GetData:table_name.
When I copy the query from GetData, add the "where" condition and run in phpmyadmin, the result is right.

Hot to apply the condition in GetData query?
I use latest github.
 
Last edited:
After adding
PHP:
$query = $this->buildQueryWhere($input->get('incfilters', 1), $query);
on line 2722 in list.php file the problem solved.
The condition
PHP:
if ($this->mergeJoinedData())
on line 2672 always return value, then the code from line 2720 will never start.
@cheesegrits can you look at this?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top