Open taylorcammack opened 2 years ago
FWIW, I'm having the same issue.
Thanks @taylorcammack for reporting this issue and sorry for holding back on my end for so long. This was definitely something that used to work. I suspect, that it broke with some of the recent Statamic Updates.
I'm on it as I need this feature for one of my current projects as well.
@taylorcammack I just stumbled on this Statamic PR and it reminded me of this Collapse Fieldtype issue. Figured I'd share here in case it's related.
Hey guys. Sorry but it's not related.
Looks like your problem here is because you aren't providing the 'meta' data properly to the sub fields.
Just to add to the above, running into the same issue with a replicator field. Getting an undefined array key in my stacktrace:
Undefined array key "field" {"userId":"....","exception":"[object] (ErrorException(code: 0): Undefined array key \"field\" at .../vendor/statamic/cms/src/Fields/Fields.php:235)
Hey guys. Sorry but it's not related.
Looks like your problem here is because you aren't providing the 'meta' data properly to the sub fields.
Do you have any idea where I could find a reference for a properly provided meta field @jasonvarga ? Didn't have any luck yet while tinkering around and looking for any examples that solve the same issue.
Hey guys. Sorry but it's not related. Looks like your problem here is because you aren't providing the 'meta' data properly to the sub fields. https://github.com/goldnead/statamic-collapse-fieldtype/blob/2d555cace5e967d755d39bfdc10498b082bc508d/resources/js/fieldtypes/Collapse.vue#L20
Do you have any idea where I could find a reference for a properly provided meta field @jasonvarga ? Didn't have any luck yet while tinkering around and looking for any examples that solve the same issue.
I think I actually have put together a solution for this in my own project, do you mind if I submit a pull request?
@mattpfeffer please go ahead! I'm curious how you solved it :) Thanks!
@mattpfeffer very curious how you solved it as well. I spun my tires for the better part of a week trying to figure it out.
The same happens when you try to use a bard field in the Collapse Fieldtype
The same happens when you try to use a bard field in the Collapse Fieldtype
Yeah, it happens with all structured data fields. I just have no idea how to solve it. Burnt a few hours already, so I'm happy for any hints :)
Hey guys, just wanted to post an update on this one. Still no luck, getting it fixed. As @jasonvarga mentioned I narrowed it down to the passing of the meta fields. I just can't get my head around, how to fix this as no documentation exists (it's really edge-casy to be fair).
I figured out how to solve the loading-indicator, but now I get another error TypeError: Cannot read properties of undefined (reading 'text_field')
when trying to include a Grid Fieldtype into the collapse.
I couldn't figure out how statamic expects the meta data to be passed down into structured fieldtypes. I'm glad for anyone to help on this one, as it is an important feature for such a "lightweight" addon.
Seems to not know how to handle using a Grid fieldtype. Just started using this add-on to test it out for a project, so not sure if this is something that used to work.