Closed soullivaneuh closed 4 years ago
buildActionFieldDescription
is called here: https://github.com/sonata-project/SonataAdminBundle/blob/0f08d0d462d718be7a7832fef215a8a6a5589ebb/Datagrid/ListMapper.php#L116
So it does effect only when you call $listMapper->add
.
BTW, actions templates mapping should not be done on the doctrine orm at all.
But I don't really know how to handle it.
@sonata-project/contributors Do you have some suggestions?
Temporary and ugly workaround waiting this issue resolution:
$options = [
'actions' => [
'show' => ['template' => 'SonataAdminBundle:CRUD:list__action_show.html.twig'],
'edit' => ['template' => 'SonataAdminBundle:CRUD:list__action_edit.html.twig'],
'delete' => ['template' => 'SonataAdminBundle:CRUD:list__action_delete.html.twig'],
],
];
Several solutions :
mergeOptions
, get the existing options, merge them with the default options and use add
buildActionFieldDescription
happens in a foreach later, after you have add the opportunity to add your options via an extensionmergeOptions
triggers a new build of the field descriptionIs this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
I have the same issue
Just don't use mergeOptions
, it's not working and this method was removed from Sonata in the v4.
Error on 3.x.
To reproduce, setup this tiny
AdminExtension
class:This class will merge default actions to defined actions if defined, adding them if not.
And this admin class:
And them define the services:
Finally, go to your api keys list. You will get this error:
It seems internal default template are auto-filled when adding the
_action
, but is lost if you merge your options.