Forum Discussion
But with restadmin request I receive the same error exception in the console "This widget could not be displayed."
Why it complains on Widget if I'm requesting data from DB, not the widget?
So I wonder, is there a way to show that author bio in the Articles for Members, who are watching that Article without Author given permission for that?
Sounds for me that we do need to request from DB the list of all users and set the setting flag to TRUE to show that bio for everybody.
him_varma is correct.
Your code is probably throwing a freemarker error for a non-admin user because one of your freemarker objects doesn't exist for a non-admin user. And of course the error message for a non-admin user won't include any useful debugging info.
The component might fail more gracefully if you add an additional check like so:
<#if (res.data.items[0].biography)?has_content>...</#if>
This will check for both not null and not empty. However, it won't address the issue of some profile fields not being retrievable for non-admin users via a rest() call. This may be an acceptable use case for restadmin().
Related Content
- 4 months ago
- 9 months ago
- 12 months ago
- 2 years ago