whitecube / nova-flexible-content

Flexible Content & Repeater Fields for Laravel Nova
MIT License
778 stars 230 forks source link

Flexible content in flexible content with repeater bug #145

Open slav-weber opened 4 years ago

slav-weber commented 4 years ago

Good day. Currently I'm working with Flexible content package and it's pretty good but I have some problems when try to use fc inside of fc with repeater. As I undarstand current package is use ACF for Wordpress philosophy. And it should be possible to work with flexible content on different deep levels. Right now I have issue with same flexible sections, for example: [My Slider] If I create first [Flexible Content in header] --[My Slider] ----[Image] ----[Image] ----[Image] --[My Slider] ----[Image] ----[Image] [Flexible Content in footer] --[My Slider] ----[Image] --[My Slider] ----[Image] ----[Image] As you can see the names of the parent flexible content areas is different, but the names of the layouts is the same. It cause errors when I'm trying to save and next edit the content. In database I have right json data about all flexible content areas and section. But when I'm going to edit it, I have dublicated output of second [Flexible Content in footer] in my [Flexible Content in header]. It's like a clone of second flexible area. I tried to debug it and resolve the problem. As I undarstand vue(js) and php before display of information works well. The problem is exactly when system try to output the data. Can you help me please to close this issue?

toonvandenbos commented 4 years ago

Hi @slav-weber,

Thanks for posting this issue. We'll take a look as soon as possible. In the meantime, if you need this to be solved as soon as possible, maybe you could try to find what is exactly causing the problem and tell us where it is located? Thank you!

slav-weber commented 4 years ago

Hi @slav-weber,

Thanks for posting this issue. We'll take a look as soon as possible. In the meantime, if you need this to be solved as soon as possible, maybe you could try to find what is exactly causing the problem and tell us where it is located? Thank you!

Yeah, I'll try to, because want to continue use FC package :D

slav-weber commented 4 years ago

@Nyratas can you help me please to find some code parts in Flexible content package? I'm intrested in:

  1. Php code which is getting json data from database and process it.
  2. The last php code which process json data before send it to the javascript or vue
  3. First enter point of the json data in javascript. In database json is right, it means the problem can be somewhere in this parts ^.
toonvandenbos commented 4 years ago

Hi @slav-weber,

  1. Data is fetched from and injected in the database with what we call a Resolver, which can be customized when needed. This is the package's default Resolver.
  2. The field processes the raw value and builds a Layouts structure from the data. Each Layout is serializable, which means you'll probably find what you're looking for in its jsonSerialize method, which also serializes the enclosed fields.
  3. The "form" Vue component initializes using the setInitialValue method, which is default Nova field behaviour.

Could you post an example of the stored data for both coexisting flexible fields? Thank you.

slav-weber commented 4 years ago

Sure, all in this post. After first save of content in db it looks like everything is fine. Problem starts when system output the data on edit page. It shows only dublication of slider-2 on place where should be slider-1 Here is screenshot scr Here is zip file with json data from DB data-from-db.zip

phrasetagg commented 3 years ago

Hello! Is it possible to solve this problem? @voidgraphics