Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field does not return serialized values via getSerializedFieldValues() #137

Open
chrismlusk opened this issue Sep 24, 2024 · 1 comment
Open

Comments

@chrismlusk
Copy link

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 {...}
]

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

Copy link

linear bot commented Sep 24, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant