Related Data counter list problem with multiselect databasejoin

ajc

New Member
Hi all,
I created a databasejoin from a list with checkbox render (multiselect) that work perfectly. Then I enable Link to list in the Related Data tab in the joined list. When I display the joined list it's always displayed 0 for the count of related data but when I click on the link I can see the expected result so it's ok. The problem is only this counter that doesn't count !
Thank you for your help
Arno
(Fabrik 3.9)
 
Last edited:
When you have a databasejoin element rendered as multiselect, there will be "yourtable__xx_repeat" database table created and in this case the related data count does not work.

I have been using my own related data column in similar cases. Just add a calc element and the content something like below. Not the ideal solution, but for me it has been useful when some modification is needed to the built in related data column.

Code:
$mydb = JFactory::getDbo();

$mydb->setQuery("SELECT COUNT(b.participants) FROM 1_mymaintable AS a
LEFT JOIN 1_myrepeattable_repeat_participants AS b ON a.id=b.participants
WHERE a.id = '{rowid}' ");
$participant = $mydb->loadResult();

$link = "index.php?option=com_fabrik&view=list&listid=20&Itemid=123&employee={rowid}&limitstart20=0&resetfilters=1";
return "<a href=".$link." target='_self'><i class='icon-list-view'> </i>(".$participant.")</a>";

Get the link data from the built in related data column.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top