• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

List of users in specified group

Sadler

Member
Hi,

I am trying to show a list of users (usernames) in a specific user group.

I have a form set up and I used a database join element to give me a dropdown list showing usernames with the value of each item being the user id. I wanted to restrict this to show only users within a specific user group so I added the following to the "data-where" tab in the additional join statements box:

LEFT JOIN foo_user_usergroup_map ON (foo_users.id=foo_user_usergroup_map.user_id) WHERE foo_user_usergroup_map.group_id=12

I am getting an error telling me I have a syntax issue but I am not able to see the problem. Anyone done something similar ?

Cheers

B
 
Your 'Joins where' filter would be...
WHERE fooo_user.id IN ( SELECT DISTINCT(user_id) FROM #__user_usergroup_map WHERE group_id=12 )
 
Hi,

thanks for that one, I was way off base. Here is the code that got it working:

WHERE foo_users_3.id IN ( SELECT DISTINCT(user_id) FROM #__user_usergroup_map WHERE group_id=12 )

I added the "s" to the table name and added "_3" which showed up in the error message, I am guessing that the system somewhere adds the suffix _3 to the table name. At any rate it works!

Thanks

Carl
 
I'm not sure this solves the problem. I'm pretty sure the _3 was added by fabrik because there are other references to foo_users in the same form - or it is in reference to the list row Id. You may need to change that _3 to a _{placeholder} that represent the row_id - and I'm not sure off the top of my head what that would be.

If that is the case, then this might work for your test user - but will it work for another user with that hard-coded '_3' added? If it still works, then (in my best Roseanne Roseannadanna voice...) "Nevermind".:oops:
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top