Open elliot-sawyer opened 1 year ago
In case anyone else finds this issue, I fixed it in project code by setting this in YML. These are the original values defined on BaseElement, being reset to an array with values in case it is null. If the code is not null, this array_merge is effectively a no-op:
DNADesign\Elemental\Models\BaseElement:
summary_fields:
EditorPreview: Summary
Latest CMS Recipe 4.13.0:
Somehow I have BaseElement.summary_fields set to null, which is weird given there's a
private static $summary_fields
value set on that class that isn't null. While I am unsure what causes it, it may be related to an obsolete ClassName that remains in the database. Via debugging, I found one solution is to adjust the DataObject::summaryFields() method to force an array:Changing
$rawFields = $this->config()->get('summary_fields');
to this:$rawFields = $this->config()->get('summary_fields') ?? [];
Another option, if PHP support is a concern, is to check if the array is falsey:
I reached out to @GuySartorelli on Slack and he said this is unlikely to be accepted without an identifiable cause, so I'm going to post the issue here in case anyone else comes across it.