Barelydead / strapi-plugin-populate-deep

A Strapi plugin that makes it easier to populate deep content structures
172 stars 39 forks source link

Fix conflicting keys on dynamic zone #31

Open Freyb opened 1 year ago

Freyb commented 1 year ago

As was described in #28 if multiple components share the same attribute name in a dynamic zone, components that are higher on the component list might not get their attributes populated.

Strapi provides two way to populate dynamic zones. As described by the docs:

When populating dynamic zones, you can choose between:

  • a shared population strategy, applying a unique behavior for all the dynamic zone's components
  • or a detailed population strategy, defining per-component populate queries using the on property.

https://docs.strapi.io/dev-docs/api/rest/populate-select#components--dynamic-zones

This PR fixes this issue by utilizing the on keyword in dynamic components

Levy-from-Odessa commented 1 year ago

Great fix, Thanks @Barelydead could you merge it, pls?

Freyb commented 1 year ago

@Barelydead Could you check it and merge it?