Closed DynamiteGoesBoom closed 2 months ago
I think I can recall why I left this until the end (but actually forgot about it during beta, whoops!).
I was unsure of the desired behaviour. With Matrix now using Entry Types, and existing fields, there's some change in behaviour. Previously all fields belonged to the Block Type, which in turn was specific to a Matrix field.
For cloning, we need to ask whether a new Entry Type should be created, and if the fields associated with those should also be cloned. This gets a little tricky with field instances as well.
I totally get that it's a little more complex with the new Entry Type and field setup. I'm just looking to clone over my main Content Builder as I have a slew of Colour Swatch fields that I want to copy over to a Global that will allow me to set each Content Builder block types' default styling within any given block.
But the more I think of it I'm still going to need to replicate the global blocks to not hold any content, but just show the Style data. Cloning might save me a ton of time but I understand the tricky nature of this request.
Thanks as always!
In your instance, what would you expect? Just the Matrix field itself to be cloned and the Entry Types it uses referring to the current ones? Or you'd also like new Entry Types created as well?
I myself am still coming to terms with the different paradigm shift of using Entry Types, so I'm not sure either 😅
I wouldn't worry about this as I already cloned all of the entryTypes and prepended Global
to them all, and assigned them to my Global Content Builder. I then attached those Entry Types and I think I'm good for now.
Thanks again!
No worries, I'll give this some more thought and see if anyone else chimes in!
@engram-design Just ran into this also - I previously used Architect in Craft 4 and would import/export entry types and sections as needed as well. If Field Manager could duplicate that functionality it would be awesome. I have a "Sales Funnel" matrix (based on Don Miller's StoryBrand) that I use in most projects. Being able to clone over entry types (which would then utilize the individual fields, repeated as needed) would be really helpful. Architect did that, but with the way relations have changed in Craft 5 I'm sure it's tricky.
That said, it's very counterintuitive to download a plugin called Field Manager, attempt to import a matrix field, and immediately get an error. Might be just time to sunset?
It wasn't my intention to leave this as they were, more keen to hear what feedback there is on the expected behaviour now things are different in Craft 5.
In 4.0.1 there's no longer an error, and there's a change in behaviour. Matrix fields and their entry types are now cloned, but the fields used in the entry types are not cloned, and still reference their original fields.
This decision is more inline with Craft's push towards re-using fields, rather than the old way of every field in a Matrix being solely for that Matrix field.
Describe the bug
I'm attempting to clone a Matrix field and get the following error:
Steps to reproduce
Craft CMS version
5.1.8
Plugin version
4.0
Multi-site?
No response
Additional context
Here's the full stack trace: