How do I trigger a modal from a template that points to a controller returning an AJAX response
You're trying to trigger your modal in multiple ways. Right now your twig is saying to open the href in a modal, but your controller is not return html, it's returning a json/ajax response to open its content in a modal.

To fix this you should do one of the following:


Update your twig to just point to the link, don't do anything there to trigger a modal. Your current ajax response from the controller is handling opening the content in a modal.
Update your controller to return html and leave your twig as-is. In this scenario your twig is handling making the content open in a modal.


I'm not sure about the _format parameter in your route definition, but I think you can just omit it.