-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundIf it breaks the basic use of the product but can be worked aroundsource: core:strapiSource is core/strapi packageSource is core/strapi packagestatus: pending reproductionWaiting for free time to reproduce the issue, or more informationWaiting for free time to reproduce the issue, or more information
Description
Bug report
Describe the bug
Creator fields are not returned by Strapi V4 REST API even when populateCreatorFields is set to true.
Steps to reproduce the behavior
- Install Strapi v4
- Start the server using
npm run develop - Using Strapi admin panel, create a collection type with a
namefield - Add an entry manually using the admin panel GUI
- Allow the collection to be queried through the public API (settings > roles and permissions > Public > add
findandfindOneon your collection and save) - Query the data using the REST API
- Creator fields are not shown which is normal as per the V4 docs since populateCreatorFields is false by default: https://docs.strapi.io/developer-docs/latest/development/backend-customization/models.html#model-options
- Change the
optionsinsrc/api/<collection>/content-types/<collection>/schema.jsonto the following:
{
"kind": "collectionType",
//...some configs
"options": {
"privateAttributes": ["name"],
"populateCreatorFields": true
},
- Make sure the server restarts or restart it
- Query the API again
Expected behavior
name field is not returned anymore
created_by field is returned
Actual behavior
name field is not returned anymore
created_by field is not returned
System
- Node.js version: v14.18.2
- NPM version: 6.14.13
- Strapi version: 4.0.4
- Database: sqlite
- Operating system: MacOS
CubedEye, redakzter01, Keimeno, DanielFortuyn, kirill3333 and 2 more
Metadata
Metadata
Assignees
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundIf it breaks the basic use of the product but can be worked aroundsource: core:strapiSource is core/strapi packageSource is core/strapi packagestatus: pending reproductionWaiting for free time to reproduce the issue, or more informationWaiting for free time to reproduce the issue, or more information