Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid data driver "doctrine/phpcr-odm" is not supported. #29

Closed
Matth-- opened this issue Jan 29, 2017 · 6 comments
Closed

Grid data driver "doctrine/phpcr-odm" is not supported. #29

Matth-- opened this issue Jan 29, 2017 · 6 comments
Labels

Comments

@Matth--
Copy link

Matth-- commented Jan 29, 2017

Hi

After doing a clean install i get the following error when trying to navigate to any admin route
image

Any idea on how to fix this?

Thanks in advance!

@Matth--
Copy link
Author

Matth-- commented Jan 30, 2017

I had to include the GridBundle/Resources/config/services/integrations/doctrine/phpcr-odm.xml config file for everything to work.

@Matth-- Matth-- closed this as completed Jan 30, 2017
@michalmarcinkowski
Copy link
Member

Reopening since this should be added to installation docs or if possible configured in the bundle. /cc @pamil

@gdecorbiac
Copy link

@Matth-- : how do you include the GridBundle/Resources/config/services/integrations/doctrine/phpcr-odm.xml config file ?

@michalmarcinkowski : it seems that you also need to mention the following code in order to complete the installation

sylius_resource:
    drivers:
        - doctrine/orm
        - doctrine/phpcr-odm

@Matth--
Copy link
Author

Matth-- commented Feb 5, 2017

@gdecorbiac

I don't know if this is the best way to do so but I'm loading the file from my AppExtension (gridloader)

<?php

namespace AppBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

class AppExtension extends Extension
{
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');

        $gridLoader = new Loader\XmlFileLoader($container, new FileLocator($container->getParameter('kernel.root_dir') . '/../vendor/sylius/sylius/src/Sylius/Bundle/GridBundle/Resources/config/services/integrations/doctrine'));
        $gridLoader->load('phpcr-odm.xml');
    }
}

If anybody knows a better way to do this...

@gdecorbiac
Copy link

thanks a lot @Matth-- for your quick answer !

@Matth--
Copy link
Author

Matth-- commented Feb 7, 2017

@gdecorbiac

I went trough the gridbundle code and actually you don't need to load the phpcr-odm.xml file.

This piece of code

foreach ($config['drivers'] as $enabledDriver) {
    $loader->load(sprintf('services/integrations/%s.xml', $enabledDriver));
}

Is being executed in the SyliusGridExtension class. It means that you can just enable this in config.yml file. You need to do the same thing for the sylius_resource and the sylius_gridconfig

sylius_grid:
    drivers:
        - doctrine/orm
        - doctrine/phpcr-odm

This means you can ignore my previous comment 😄

@pamil pamil closed this as completed in ead9891 Mar 15, 2017
pamil added a commit that referenced this issue Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants