nova-flexible-content icon indicating copy to clipboard operation
nova-flexible-content copied to clipboard

Compatibility with Nova Dependency Container

Open dividy opened this issue 5 years ago • 9 comments

Hello,

Anybody else having issues with Nova Dependency Container inside Flexible Content ? I'm using a custom Preset & Resolver. Data is saved correctly in the DB.

If I add 2 products to my "product" layout, the 1st product's fields have the last product's values. (eg. in DB: sale_price: 3/sale_price:1 gives sale_price:1/sale_price:1 in the edit form...)

Any idea ?

dividy avatar Dec 17 '19 07:12 dividy

Hi @dividy,

Is your issue similar to #129 ?

toonvandenbos avatar Jan 08 '20 15:01 toonvandenbos

No, this is not similar to 129.

Confirm this is still happening in:

  • laravel/nova v3.6.0
  • epartment/nova-dependency-container 1.2.11
  • whitecube/nova-flexible-content v0.2.5

I checked this should be a data displaying issue.

In Update Form

all flexible elements' values are replaced by the last flexible element value if using NovaDependencyContainer

deckchan avatar Aug 30 '20 06:08 deckchan

Hello! Is it possible to solve this problem? And i can't fiind an issue wich is duplicated by this one @Nyratas

phrasetagg avatar Apr 25 '21 10:04 phrasetagg

Hi @phrasetagg, thanks for the feedback. I'm hoping to find some time for these urgent issues soon.

toonvandenbos avatar Apr 26 '21 19:04 toonvandenbos

This seems to be due to duplicate field IDs - caused by the flexible "key" not being appended to the field ID for all fields in a NovaDependencyContainer that's housed in a Flexible.

Blindmikey avatar May 26 '21 22:05 Blindmikey

Trying to narrow down the issue, it looks like renameFields() isn't being fired for fields inside of NovaDependencyContainer fields.

Blindmikey avatar May 27 '21 00:05 Blindmikey

Solved my issue by using a custom class extending layout and using duplicateAndHydrate()

Blindmikey avatar May 27 '21 21:05 Blindmikey

Solved my issue by using a custom class extending layout and using duplicateAndHydrate()

Can you please share your solution?

MorningAM avatar Dec 18 '23 05:12 MorningAM

There's a workaround mentioned in this issue

daanadriaan avatar Nov 21 '24 11:11 daanadriaan