Sonata Admin: One-to-many route to show action instead of edit

My problem is simple, but I can’t find an answer anywhere in the docs or the code…

When configuring show fields for a one-to-many relation, the records correctly appear in a list on the show page. They incorrectly link to the records edit action instead of the show action. Is there an easy way to change this. Intuitively, I would guess it would look something like this:

$showMapper
  ->add('items', null, [
    'action' => 'show',
  ])
;

This obviously didn’t work.

Also if anyone can point me to documentation where it lists what key value pairs are possible for $fieldDescroptionOptions that would be very helpful.

Source: Symfony Questions

LEAVE A COMMENT