Cannot use object of type Closure as array
~/plugins/samuell/revisions/formwidgets/RevisionHistory.php line 251
$optionConfig = $field->config['options'];
foreach ($oldValue as $item) {
$old .= isset($optionConfig[$item]) ? $optionConfig[$item] . ' • ' : '';
}
if (isset($field->config['options'])) {
return $this->getOptionsDiff($field, $oldValue, $newValue);
}
private function getDiff($fieldName, $oldValue, $newValue)
{
$fields = $this->parentForm->getFields();
if (array_key_exists($fieldName, $fields)) {
...
if (isset($field->config['widget']) && $field->config['widget'] === 'repeater') {
return Diff::htmlDiff(e($oldValue), e($newValue));
}
if (isset($field->config['options'])) {
return $this->getOptionsDiff($field, $oldValue, $newValue);
}
}
return Diff::htmlDiff(e($oldValue), e($newValue));
}
private function getOptionsDiff($field, $oldValue, $newValue)
{
$optionConfig = $field->config['options']();
...
}