当我尝试使用可编辑选项更新数据时出现 configureListFields 问题
configureListFields issue when I try to update a data with editable option
我实际上是在尝试添加更新 SonataList 中字段的可能性。
我遵循了 symfony 的文档 => https://symfony.com/doc/3.x/bundles/SonataAdminBundle/reference/action_list.html
我做了这个代码
->add('status', 'choice', [
'label' => 'Status',
'class' => 'secret',
'editable' => true,
'choices' => [
$inquiry_service::_statusInWaiting => 'En attente',
$inquiry_service::_statusValidated => 'Validé',
$inquiry_service::_statusRejected => 'Rejeté',
结果是我可以在列表中 select 我的 3 个选择,但是当我尝试更新数据时出现以下错误 =>
Catchable Fatal Error: Method WF\Sonata\AdminBundle\Admin\FieldDescription::__toString() must return a string value
我错过了哪些选项?
几个小时后,我发现 FieldDescription 对象返回 'true' 到 '$this->getLabel' 并且由于版本过时,这是一个奏鸣曲问题。
为了在不更新我的版本的情况下解决这个问题,我创建了一个带有选择表单的模板。
我实际上是在尝试添加更新 SonataList 中字段的可能性。
我遵循了 symfony 的文档 => https://symfony.com/doc/3.x/bundles/SonataAdminBundle/reference/action_list.html
我做了这个代码
->add('status', 'choice', [
'label' => 'Status',
'class' => 'secret',
'editable' => true,
'choices' => [
$inquiry_service::_statusInWaiting => 'En attente',
$inquiry_service::_statusValidated => 'Validé',
$inquiry_service::_statusRejected => 'Rejeté',
结果是我可以在列表中 select 我的 3 个选择,但是当我尝试更新数据时出现以下错误 =>
Catchable Fatal Error: Method WF\Sonata\AdminBundle\Admin\FieldDescription::__toString() must return a string value
我错过了哪些选项?
几个小时后,我发现 FieldDescription 对象返回 'true' 到 '$this->getLabel' 并且由于版本过时,这是一个奏鸣曲问题。
为了在不更新我的版本的情况下解决这个问题,我创建了一个带有选择表单的模板。