Seems like the integration between roles & permissions plugin and Cloudinary is not good,
I’m able to populate images from all the custom content types, but for some reason the relations and media fields added to the user’s content type (which is there by default) are not being sent.
I tested with regular fields and those are being sent (I mean text, boolean, and so on…), but media files and relations are not working.
Already tried sending “populate=*”, “populate=avatar” and “populate[0]=avatar” attributes. But I don’t know if this is a population problem or not
I just found the answer guys, there is a bug in the roles & permissions plugin related to population. There is an issue opened on Github that probably will be merged soon: https://github.com/strapi/strapi/issues/11957
You can use this workaround in the meantime:
Open your Strapi app on a code editor. (Make sure your app is not running during the process)
Create a file called 'strapi-server.js’ route ‘src/extensions/users-permissions/strapi-server.js’ if it doesn’t exist and add the following.
Note that you have a controller for every endpoint, findOne, find and so on…
you need to add the fields you want to populate to the 'populate: ’ values as an array of strings. Example:
Hi @AntonioChagoya I don’t if this helps or may be an alternative. This is specific to components attached to a content type entry. I have a content type called works and attached a component called images. I needed to make a component in order to be able to arrange images.
With all that said I similarly was having problems accessing the media attached to this component.
I resolved it by alter my populate request like this.
Yes you are right, this is specific to the /api/users endpoint, which is attached to the Roles & Permissions plugin, so this workaround only works for images population on the Users content-type and it’s relations.
For example, adding an Avatar image field to the Users content-type
I just put the basic workaround for it, official Strapi account suggest using that workaround, it is true that prevents filtering on first instance, but you can access the ctx.req and access the query object to add parameters to the endpoint