Sonata Admin 嵌套集合表单创建不起作用但删除和编辑可以

问题描述

我在与奏鸣曲管理形式映射器嵌套CollectionType一些问题。 母体形式看起来像这样:

protected function configureFormFields(FormMapper $formMapper)
    {
$formMapper
// ....
->with('group.CustomerServices',['description' => 'description.contract.CustomerServices'])
                ->add(
                    'services',CollectionType::class,[
                        'entry_type'   => ServiceType::class,'required'     => false,'allow_add'    => true,'allow_delete' => true,'by_reference' => false,]
                )
 ->end()
// ....

然后是孩子的ServiceType

    public function buildForm(FormBuilderInterface $builder,array $options)
    {
        $builder
            ->add('obligation',ChoiceType::class,[
                'required' => true,'choices'  => ServiceObligationEnum::getChoices(),])
            ->add('interval',[
                'required'    => false,'choices'     => ServiceIntervalEnum::getChoices(),],])
            ->add('value',SebastianMoneyType::class,])
            ->add('currency','choices'     => CurrencyEnum::getChoices(),]);

Submiting编辑按钮 - >编辑现有的服务也删除它们正在.. 但是,增加一个新的,submiting发送一个正确的POST请求(使用选定的值),但在前端访问该服务时,一切都在默认值。有人可以解释我在哪里可以检查POST请求的处理方式,并帮助我了解工作流程为何增加/ create不工作,同时删除和编辑做。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...