Lakion / CmsPlugin

Simple CMS on top of SymfonyCMF for Sylius applications.
http://lakion.com
26 stars 20 forks source link

Parent must be an object NULL given. #39

Closed stefandoorn closed 7 years ago

stefandoorn commented 7 years ago

I'm using versions:

$ composer info | grep sylius
77:lakion/sylius-cms-bundle                         dev-master 194229d Simple CMS for Sylius.
157:sylius/sylius                                    dev-master e36787e E-Commerce platform for PHP, based on Symfony framework.

When I go to 'admin/routes/new' the following error is thrown: Parent must be an object NULL given.

Plain text stack trace:

[1] Doctrine\ODM\PHPCR\Exception\InvalidArgumentException: Parent must be an object NULL given.
    at n/a
        in /var/www/webshop/vendor/symfony-cmf/routing-bundle/src/Doctrine/Phpcr/Route.php line 88

    at Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route->setParentDocument(null)
        in /var/www/webshop/vendor/lakion/sylius-cms-bundle/src/Factory/RouteFactory.php line 49

    at Lakion\SyliusCmsBundle\Factory\RouteFactory->createNew()
        in /var/www/webshop/vendor/sylius/sylius/src/Sylius/Bundle/ResourceBundle/Controller/NewResourceFactory.php line 27

    at Sylius\Bundle\ResourceBundle\Controller\NewResourceFactory->create(object(RequestConfiguration), object(RouteFactory))
        in /var/www/webshop/vendor/sylius/sylius/src/Sylius/Bundle/ResourceBundle/Controller/ResourceController.php line 243

    at Sylius\Bundle\ResourceBundle\Controller\ResourceController->createAction(object(Request))
        in  line 

    at call_user_func_array(array(object(ResourceController), 'createAction'), array(object(Request)))
        in /var/www/webshop/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 153

    at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
        in /var/www/webshop/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 68

    at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
        in /var/www/webshop/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php line 168

    at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
        in /var/www/webshop/web/app_dev.php line 43
stefandoorn commented 7 years ago

I think #37 is the same.

ychen8610 commented 7 years ago

it is caused by uninitialized phpcr repository. exec the following command: $ php bin/console doctrine:phpcr:repository:init