strapi-plugin-populate-deep icon indicating copy to clipboard operation
strapi-plugin-populate-deep copied to clipboard

fix: deep assign populated objects

Open HonzaTuron opened this issue 1 year ago • 11 comments

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 } }.

HonzaTuron avatar Oct 09 '23 09:10 HonzaTuron

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

jomarmontuya avatar Oct 09 '23 15:10 jomarmontuya

@jomarmontuya It's possible. Check this comment.

HonzaTuron avatar Oct 09 '23 15:10 HonzaTuron

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

HonzaTuron avatar Nov 05 '23 13:11 HonzaTuron

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

trijpstra-fourlights avatar Nov 08 '23 11:11 trijpstra-fourlights

@Barelydead any chance to get this PR moving?

y-nk avatar Dec 04 '23 09:12 y-nk

username checks out

y-nk avatar Jun 12 '24 04:06 y-nk

I Will have a look this week

Barelydead avatar Jun 17 '24 12:06 Barelydead

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

HonzaTuron avatar Jul 30 '24 13:07 HonzaTuron

@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.

jomarmontuya avatar Jul 30 '24 13:07 jomarmontuya

@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.

y-nk avatar Jul 31 '24 03:07 y-nk

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

HonzaTuron avatar Sep 04 '24 08:09 HonzaTuron