When calling the Element's getSerializedFieldValues() method on an element that has a Colour Swatches field in the field layout, the return is not serialized — it's the model.
In the following example, I have an element with a field handle colorTheme.
When I call:
$element->getSerializedFieldValues();
I get:
[
// other fields, which are all serialized as expected...
'colorTheme' => percipiolondon\colourswatches\models\ColourSwatches {...}
]
When calling the Element's
getSerializedFieldValues()
method on an element that has a Colour Swatches field in the field layout, the return is not serialized — it's the model.In the following example, I have an element with a field handle
colorTheme
.When I call:
I get:
That method calls each field's
serializeValues()
method here in Craft source.I do see in this plugin's source that the Colour Swatches field has its own
serializeValues()
implementation, so I'm not quite sure what is happening.Craft v4.11.5 Colour Swatches v4.5.2