I keep getting a message saying 'This widget could not be displayed.'
Hi Im having some issues with a attempt/recover block. The code i have written below will loop 3 times and retrieve the the attached image url. I have added this attempt block as some blog articles dont have an image and i will use the recover section to assign a default place holder image.
<#assign threads = rest("blogs/id/sports_blog/threads/recent?page=1&page_size=3")>
<#list threads.threads.thread as t>
<#assign images = rest("${t.messages.topic.@href}/uploads/attachments")>
<#attempt>
<#assign imageUrl = "${images.attachments.attachment.url}">
<#recover>
FAILED
</#attempt>
</#list>
My problem is that on Lithium studio Component tab when im testing this it all works fine (the text FAILED is displayed once as i have one image which is missing) http://d.pr/i/79pQ, however when i put this component on to my page it shows me the message 'This widget could not be displayed.' rather than the FAILED text http://d.pr/i/lBJ5. Could anyone show me why this is happening?
I have finally got to the bottom of this issue. It turns out that it wasnt the attempt recover block which was causing the problem it was indeed a permissions issues as Adam mentioned in an earlier post. If you do a rest call and you do not have the correct permissions the message 'This widget could not be displayed.' is shown, even if you are not currently using the responce from the rest call.
If you get this message and you are not sure why, check all of your API calls using in a browser and you might find a message similar to this
User -1 does not have the following permission(s) at XYZ: [ read_board ]
I had to ensure that all my users had a role with the 'see boards' permission set. This can be done in admin -> users -> roles