Barelydead / strapi-plugin-populate-deep

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

fix: deep assign populated objects #43

Open HonzaTuron opened 11 months ago

HonzaTuron commented 11 months ago

Current implementation of getFullPopulateObject doesn't merge objects from different dynamic zones deeply.

If you try to merge objects with lodash, it'll merge them shallowly, so booleans have higher priority than objects when passed as second argument. This can result into bugs described in #42, #41. Can be reproduced with code merge({ a: { b: true } }, { a: true }), which results to { a: true }

Following code will make objects prioritised above boolean, so result of deepAssign({ a: { b: true } }, { a: true }) is { a: { b: true } }.

jomarmontuya commented 11 months ago

I also happen to have this issues, is there a way to patch this on my deps even it's not yet merged ?

HonzaTuron commented 11 months ago

@jomarmontuya It's possible. Check this comment.

HonzaTuron commented 10 months ago

@Barelydead Would you have a time for review this and/or release new version?

trijpstra-fourlights commented 10 months ago

@Barelydead please merge this ASAP, this plugin is broken without it.

y-nk commented 9 months ago

@Barelydead any chance to get this PR moving?

y-nk commented 2 months ago

username checks out

Barelydead commented 2 months ago

I Will have a look this week

HonzaTuron commented 1 month ago

@Barelydead Is there any chance to transfer ownership of this library? It's quite popular but not so well maintained :(

jomarmontuya commented 1 month ago

@Barelydead Is there any chance to transfer ownership of this library? It's quite popular but not so well maintained :(

How about fork it and maintain yourself? that can be another option but I agree this is quite popular and kudos to the @Barelydead who initiated it.

y-nk commented 1 month ago

@jomarmontuya fork could work, but there will be "a battle of forks" + you still need a PR on the readme to mention the fork otherwise there's no info about it + the fork will be eventually be unmaintained, then you'll transpose this issue to that other fork etc etc...

if the maintainer themselves could transfer ownership it'd be a bit nicer, but yeah... not always happening.

HonzaTuron commented 2 days ago

Hello, I've just released fork of this plugin including fix of this issue. Available here: https://www.npmjs.com/package/strapi-plugin-deep-populate

or

npm i strapi-plugin-deep-populate