Closed soullivaneuh closed 3 years ago
Is 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.
You can implement your own ModelManager and overriding the function
public function getNewFieldDescriptionInstance($class, $name, array $options = [])
{
if (!isset($options['route']['name'])) {
$options['route']['name'] = 'show';
}
return parent::getNewFieldDescriptionInstance($class, $name, $options);
}
But I agree that there is no sens to link to the edit
page. IMO this should link to the show
one.
Maybe we could change this behaviour for the 4.0. @sonata-project/contributors ?
show
will be the default behavior in 4.0. An option could be interesting but is not necessary anymore.
Concerning those templates: https://github.com/sonata-project/SonataAdminBundle/tree/1a46603f9d4cf44edab5b73d49751f1848630fb0/src/Resources/views/CRUD/Association
And maybe the old ones from ORM/ODM bundles.
The default route name for association links is
edit
.First, that does not really make sens to show the entity form when you click on a link from the list, but why not.
Second, there is no way to have the route set to
show
as default, except filling the option on each field of each admin class.It would be great to have an option for that, maybe on configuration.
Note: I was sure to already open an issue like this, but I can't retrieve it.