Closed Norbz closed 2 months ago
Hello @Norbz. We had similar issues within our dynamic zone component. Following patch fixed it.
diff --git a/node_modules/strapi-plugin-populate-deep/server/helpers/index.js b/node_modules/strapi-plugin-populate-deep/server/helpers/index.js
index 7f026b8..2a95ea9 100644
--- a/node_modules/strapi-plugin-populate-deep/server/helpers/index.js
+++ b/node_modules/strapi-plugin-populate-deep/server/helpers/index.js
@@ -1,4 +1,4 @@
-const { isEmpty, merge } = require("lodash/fp");
+const { isEmpty, mergeWith } = require("lodash/fp");
const getModelPopulationAttributes = (model) => {
if (model.uid === "plugin::upload.file") {
@@ -32,7 +32,7 @@ const getFullPopulateObject = (modelUid, maxDepth = 20, ignore) => {
} else if (value.type === "dynamiczone") {
const dynamicPopulate = value.components.reduce((prev, cur) => {
const curPopulate = getFullPopulateObject(cur, maxDepth - 1);
- return curPopulate === true ? prev : merge(prev, curPopulate);
+ return curPopulate === true ? prev : mergeWith(prev, curPopulate, (obj, src) => ({ ...obj, ...src }));
}, {});
populate[key] = isEmpty(dynamicPopulate) ? true : dynamicPopulate;
} else if (value.type === "relation") {
Hi
I've encountered an issue where one of our component isn't being populated (there's a missing "cover" media field) no matter what depth we specify. The said component is in a dynamic zone.
The strange thing is that the bug occurs on a singleType that is almost the duplication of another collectionType that is working perfectly.
Here is the definition of the faulty singleType
The component
data.custom-project-list
is missing it's cover field. I've switched the homepage into a collectionType without any success. In any case does the populate param include this :[content][populate][items][populate][cover]=true
The "working" collectionType has the same dynamic zone with the same components, same name (content), just different fields around... I've forked the plugin and traced everything, I cannot understand the differences between my two content-types in terms of behavior from the plugin...
Does anyone has any issue similar to this ?