0
Я хочу добавить ckeditor в поле содержимого в блоке admin. Вот что я сделал до сих пор:sonata admin add richhtml editor для блокировки содержимого
- добавил raw_content и content_formatter свойства моего блока
модифицированный buildEditForm в TextBlockService к этому:
public function buildEditForm(FormMapper $formMapper, BlockInterface $block) { $formMapper->add('settings', 'sonata_type_immutable_array', array( 'keys' => array( array('content', 'sonata_formatter_type', array( 'event_dispatcher' => $formMapper->getformBuilder()->getEventDispatcher(), 'format_field' => ['content_formatter'], 'source_field' => ['raw_content'], 'source_field_options' => array( 'attr' => array('class' => 'span10', 'rows' => 10) ), 'listener' => true, 'target_field' => ['content'] )), ) )); }
Он работает просто отлично, позволяя мне выбрать «richhtml» из списка редакторов, но когда я попытаюсь сохранить блок, он выдает ошибку:
Expected argument of type "string or Symfony\Component\PropertyAccess\PropertyPathInterface", "NULL" given
Как я могу это исправить?