Custom Component: Recent post by roles.name not working
Hi Community,
Currently we are using a custom component to show the latest posts from a specific group of users.
In our platform we have 2 main categories that work as different communities. One is in Spanish and one in Portuguese.
So, in order to show the posts for each category, we use a key text to differentiate each one.
Saying that, this is what we are using:
<#assign rolestop=text.format("custom.query.top_users","") />
<#assign authorQuery="select id from users where roles.name IN (${rolestop})" />
<#assign authors=commonFunctionUtils.executeLiQLQuery(authorQuery) />
<#if authors?size gt 0>
<#assign authorListArray=[] />
<#list authors as author>
<#assign authorListArray=authorListArray + [author.id] />
</#list>
<#assign authorList=authorListArray?join("','") />
<#assign messagesQuery="select id,subject,body, post_time,view_href,author.login, author.id, board.id,board.title,board.view_href,post_time,post_time_friendly,user_context.read,conversation.solved, kudos.sum(weight), board.title, board.id,metrics,replies.count(*) from messages where category.id = '${coreNode.id}' and author.id IN ('${authorList}') order by post_time desc LIMIT 10" />
<#assign parceirosPosts=commonFunctionUtils.executeLiQLQuery(messagesQuery) />
<#if parceirosPosts?size gt 0>
<#list parceirosPosts as parceiroPost>
<#assign authorPostQuery="select rank, view_href, login, id, avatar from users where id = '${parceiroPost.author.id}'" />
<#assign authorPost=commonFunctionUtils.executeLiQLQuery(authorPostQuery)[0] />
[...]
In the key text (for the version in SP) we are using exactly this one
custom.query.top_users = 'Artesando de Noxus','Escudero de Demacia','Inventor de Hextech','Trovador de Jonia','Soporte al jugador'
Now the problem:
The component is only showing the posts from authors with 'Soporte al Jugador' role and ignoring all others. If I remove that role from the key-text, it shows all the others without problem.
I really don't have a clue why this is happening. I would really appreciate your help.
Thanks in advance!
KR,