You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed this for a while and tried to trace the problem (with no luck).
If I am using a TreeMultiSelectField (in getCMSFields) then the value is not set in EditHandler.
The only way I can force this to happen is to overwrite EditHandler::getRecordEditFields() like so:
private function getRecordEditingFields(DataObject $record)
{
$tempForm = Form::create(
$this,
'TempEditForm',
$record->getCMSFields(),
FieldList::create()
);
$tempForm->loadDataFrom($record);
$fields = $tempForm->Fields();
$fields = $this->filterRecordEditingFields($fields, $record->ID);
// Relation field of type TreeMultiSelectField has to have its value forcefully set to a comma
// seperated srting
$fields['Categories']->setValue(implode(",", $record->Categories()->column('ID')));
return $fields;
}
The only way I can think to change this is maybe look for fields that are instances of TreeMultiSelectField and forcefully set their value?
The text was updated successfully, but these errors were encountered:
I have noticed this for a while and tried to trace the problem (with no luck).
If I am using a
TreeMultiSelectField
(in getCMSFields) then the value is not set inEditHandler
.The only way I can force this to happen is to overwrite
EditHandler::getRecordEditFields()
like so:The only way I can think to change this is maybe look for fields that are instances of
TreeMultiSelectField
and forcefully set their value?The text was updated successfully, but these errors were encountered: