0
votes

I'm using sonata mongoDB admin Bundle and i'm getting some problems, in fact I have a document ("Quizz") which references ("QuizzPart"):

/**
 * @var ArrayCollection
 * @MongoDB\ReferenceMany(targetDocument="QuizzPart", cascade={"all"})
 */
protected $quizzParts = array();

and the ("QuizzPart") itself references many questions :

/**
 * @var ArrayCollection
 * @MongoDB\ReferenceMany(targetDocument="Question", cascade={"all"})
 */
protected $questions = array();

The problem is that when I try to construct a new quiz from my admin class, in the configureFormFields, I can add new parts but I can add the model quizzPart but not the questions which are referenced by the quizz part. the add new (of the question) seems not doing anything. this is the code snippet from my admin class :

    ->add('quizzParts', 'sonata_type_collection', array('label' => 'ajouter une partie')
        , array(
        'edit'     => 'inline',
        'inline'   => 'table',
        'sortable' => 'id',
        )) ; 

Any one knows the reason of this bug please ? thank you

1

1 Answers

0
votes

After searching and searching I found that it is a sonata admin's bug, and we can't use imbricated sonata_type_collection and there is not an issue until now, take a look here : https://github.com/sonata-project/SonataAdminBundle/issues/262