Skip to content

Loading…

Doctrine cannot find class Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree #113

Closed
greg0ire opened this Issue · 12 comments

3 participants

@greg0ire

When I click on a node in the content tree, the following request is done : http://cmf-sandbox.vm/admin/browser/odm-children?root=cms%2Fcontent%2Fstatic

and here is the body of the response I'm getting:

/*
[exception] 500 | Internal Server Error | Doctrine\Common\Persistence\Mapping\MappingException
[message] The class 'Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree' was not found in the chain configured namespaces Doctrine\ODM\PHPCR\Document, Symfony\Cmf\Bundle\MultilangContentBundle\Document, Symfony\Cmf\Bundle\MenuBundle\Document, Symfony\Cmf\Bundle\ContentBundle\Document, Symfony\Cmf\Bundle\BlockBundle\Document, Symfony\Cmf\Bundle\SimpleCmsBundle\Document, Sandbox\MainBundle\Document, Sandbox\BlockBundle\Document, Symfony\Cmf\Bundle\RoutingExtraBundle\Document
[1] Doctrine\Common\Persistence\Mapping\MappingException: The class 'Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree' was not found in the chain configured namespaces Doctrine\ODM\PHPCR\Document, Symfony\Cmf\Bundle\MultilangContentBundle\Document, Symfony\Cmf\Bundle\MenuBundle\Document, Symfony\Cmf\Bundle\ContentBundle\Document, Symfony\Cmf\Bundle\BlockBundle\Document, Symfony\Cmf\Bundle\SimpleCmsBundle\Document, Sandbox\MainBundle\Document, Sandbox\BlockBundle\Document, Symfony\Cmf\Bundle\RoutingExtraBundle\Document
                at n/a
                    in /home/users/gparis/workspace/cmf-sandbox/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php line 38

                at Doctrine\Common\Persistence\Mapping\MappingException::classNotFoundInNamespaces('Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree', array('Doctrine\ODM\PHPCR\Document', 'Symfony\Cmf\Bundle\MultilangContentBundle\Document', 'Symfony\Cmf\Bundle\MenuBundle\Document', 'Symfony\Cmf\Bundle\ContentBundle\Document', 'Symfony\Cmf\Bundle\BlockBundle\Document', 'Symfony\Cmf\Bundle\SimpleCmsBundle\Document', 'Sandbox\MainBundle\Document', 'Sandbox\BlockBundle\Document', 'Symfony\Cmf\Bundle\RoutingExtraBundle\Document'))
                    in /home/users/gparis/workspace/cmf-sandbox/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php line 114

                at Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain->loadMetadataForClass('Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree', object(ClassMetadata))
                    in /home/users/gparis/workspace/cmf-sandbox/vendor/doctrine/phpcr-odm/lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadataFactory.php line 127

                at Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory->doLoadMetadata(object(ClassMetadata), null, false, array())
                    in /home/users/gparis/workspace/cmf-sandbox/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php line 302

                at Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->loadMetadata('Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree')
                    in /home/users/gparis/workspace/cmf-sandbox/vendor/doctrine/phpcr-odm/lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadataFactory.php line 95

                at Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory->loadMetadata('Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree')
                    in /home/users/gparis/workspace/cmf-sandbox/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php line 205

                at Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor('Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree')
                    in /home/users/gparis/workspace/cmf-sandbox/vendor/doctrine/phpcr-odm/lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadataFactory.php line 80

                at Doctrine\ODM\PHPCR\Mapping\ClassMetadataFactory->getMetadataFor('Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree')
                    in /home/users/gparis/workspace/cmf-sandbox/vendor/sonata-project/doctrine-phpcr-admin-bundle/Sonata/DoctrinePHPCRAdminBundle/Model/ModelManager.php line 49

                at Sonata\DoctrinePHPCRAdminBundle\Model\ModelManager->getMetadata('Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree')
                    in /home/users/gparis/workspace/cmf-sandbox/vendor/sonata-project/doctrine-phpcr-admin-bundle/Sonata/DoctrinePHPCRAdminBundle/Tree/PhpcrOdmTree.php line 189

                at Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree->getDocumentChildren(null)
                    in /home/users/gparis/workspace/cmf-sandbox/vendor/sonata-project/doctrine-phpcr-admin-bundle/Sonata/DoctrinePHPCRAdminBundle/Tree/PhpcrOdmTree.php line 152

                at Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree->documentToArray(null)
                    in /home/users/gparis/workspace/cmf-sandbox/vendor/sonata-project/doctrine-phpcr-admin-bundle/Sonata/DoctrinePHPCRAdminBundle/Tree/PhpcrOdmTree.php line 86

                at Sonata\DoctrinePHPCRAdminBundle\Tree\PhpcrOdmTree->getChildren('cms/content/static')
                    in /home/users/gparis/workspace/cmf-sandbox/vendor/symfony-cmf/tree-browser-bundle/Symfony/Cmf/Bundle/TreeBrowserBundle/Controller/TreeBrowserController.php line 48

                at Symfony\Cmf\Bundle\TreeBrowserBundle\Controller\TreeBrowserController->processNode('cms/content/static', 'getChildren')
                    in /home/users/gparis/workspace/cmf-sandbox/vendor/symfony-cmf/tree-browser-bundle/Symfony/Cmf/Bundle/TreeBrowserBundle/Controller/TreeBrowserController.php line 66

                at Symfony\Cmf\Bundle\TreeBrowserBundle\Controller\TreeBrowserController->childrenAction(object(Request))
                    in  line 

                at call_user_func_array(array(object(TreeBrowserController), 'childrenAction'), array(object(Request)))
                    in /home/users/gparis/workspace/cmf-sandbox/app/bootstrap.php.cache line 1419

                at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
                    in /home/users/gparis/workspace/cmf-sandbox/app/bootstrap.php.cache line 1383

                at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
                    in /home/users/gparis/workspace/cmf-sandbox/app/bootstrap.php.cache line 1559

                at Symfony\Bundle\FrameworkBundle\HttpKernel->handle(object(Request), '1', true)
                    in /home/users/gparis/workspace/cmf-sandbox/app/bootstrap.php.cache line 610

                at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
                    in /home/users/gparis/workspace/cmf-sandbox/web/app_dev.php line 29


*/

Looks like Symfony does not search the sonata namespace. What can I try?

@uwej711
Symfony CMF member
@greg0ire

Seems to be the same issue indeed, since this occurs after I added a new node as a child of the one I'm trying to open. If I delete the node, it works correctly again.

@uwej711
Symfony CMF member
@greg0ire

I'm doing this through the sonata gui, so and I don't know anything about this annotation. I just installed the sandbox, and tried creating a new page under content/static . This node already has children, and lists them correctly.

I did some debugging and it turns out the problem comes from the absence of children in the node I created. All other nodes have one, but my node has null as documentChildren

@dbu dbu closed this in 1acd072
@dbu
Symfony CMF member

hi @greg0ire , took a while but i fixed the sonata issue now. would you mind updating the sonata admin thing and check if the bug is gone?

composer update sonata-project/doctrine-phpcr-admin-bundle
@greg0ire

Hello, I'll try to remember to check monday, have a good week-end.

@greg0ire

Now I'm getting another error:

Call to undefined method Symfony\Cmf\Bundle\MultilangContentBundle\Admin\MultilangMenuItemAdmin::getUrlsafeIdentifier() in /home/users/gparis/workspace/cmf-sandbox/vendor/sonata-project/doctrine-phpcr-admin-bundle/Sonata/DoctrinePHPCRAdminBundle/Tree/PhpcrOdmTree.php on line 137

Maybe I should try updating more libraries?

@dbu
Symfony CMF member

ah, uh. indeed. hm, we still refactor all over the place, sorry. can you update your sandbox and try a full composer update? it should work.

@dbu
Symfony CMF member

or actually, you can try the stable-deps branch that is not yet merged into master. it should have good dependencies that are up to date. (you need to self-update composer maybe)

@greg0ire

Still getting the error after a full update, let's try the stable-deps branch.

@greg0ire

Works far better, thanks. Problem solved.

@dbu
Symfony CMF member

cool, thanks for checking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.