Updating matrix field from font-end with $entry->setFieldValue() pulls in Cp bundle on save I have an entry with a matrix field which I'm updating from front-end. The update works fine, but when the (font-end) page reloads after submitting the form, the CP bundle assets get included (selectize.css, craft.css, charts.css). If I then reload the page, the CP assets are no longer included. I believe have narrowed it down to the use of $entry->setFieldValue(). Does anyone know why that's happening and how to stop it? Or is there a different way to update an entry with a matrix field from font-end that doesn't require me to use setFieldValue()?

Here's the relevant part of my update function:

$field = Craft::$app-&gt;getFields()-&gt;getFieldByHandle('fieldHandle');
$existingMatrixQuery = $entry-&gt;getFieldValue('fieldHandle');

$serializedMatrix = $field-&gt;serializeValue($existingMatrixQuery, $entry);
$serializedMatrix['new1'] = [
    'type' =&gt; 'update',
    'enabled' =&gt; 1,
    'collapsed' =&gt; true,
    'fields' =&gt; array_merge($params['fields'], $params['required'])
];
$entry-&gt;setFieldValue('fieldHandle', $serializedMatrix);

if (Craft::$app-&gt;getElements()-&gt;saveElement($entry)) {
    return true;
}
Turns our it was this line causing the issue:

'collapsed' =&gt; true,


Removed it and all works as expected.