A
A
AJ2015-08-17 13:54:41
symfony
AJ, 2015-08-17 13:54:41

How to make SonataMediaBundle + SonataAdminBundle => gallery in tab work?

Good afternoon. The essence of the problem is this. Installed / configured the above-mentioned bundles, started knitting the whole thing with each other. In one of the interfaces, I needed to integrate an editable gallery. Configured by sonata_type_admin. And at the first creation everything is OK (when in popup). You can add and edit photos. Everything is working. But when you save and switch to Tab, then everything is not so good. The gallery can be edited, but photos cannot be added.
After n-th amount of time and debugging, I found out that SonataAdmin adds the wrong code, pcode and puniqid to the link when making an AJAX request. Those. takes the parent data from the top Entity. Maybe I'm just doing something wrong?
Here's how I connect the gallery:

->tab('Галерея')
    ->with('Галерея')
        ->add('gallery', 'sonata_type_admin', ['label' => 'Галерея клуба', 'required' => false, 'delete' => false, 'btn_add' => false])
    ->end()
->end();

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question