Question

Excuse my English, but it is very, very, very bad.

I am installing Sylius as indicated here

http://docs.sylius.org/en/latest/bundles/SyliusProductBundle/installation.html

Install Sylius so

"sylius/product-bundle": "dev-master"

When trying to update database, shows me this error

FatalErrorException: Error: Class 'Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass'
not found in C:\wamp\www\Sylius\symfony\vendor\sylius\product-bundle\Sylius\Bundle\ProductBundle\SyliusProductBundle.php line 61

my AppKernel

$bundles = array(
            new Sylius\Bundle\ProductBundle\SyliusProductBundle(),
            new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new AN\WebBundle\ANWebBundle(),
        );

Run composer to update everything. After that I went back to try to update the database and the error was the same

I'm working with a new installation of Symfony 2.3.4

Help :(

EDIT:

Thank you very much for responding.

Indeed with what you indicate and I have not that error! if not I have another .... : (

InvalidArgumentException: There is no extension able to load the configuration for "stof_doctrine_extensions" (in C:\wamp\www\Sylius\symfony\app/config\config.yml). Looked for namespace "stof_doctrine_extensions", found "framework", "security", "twig", "monolog", "swiftmailer", "assetic", "sylius_product", "sylius_resource", "doctrine", "sensio_framework_extra", "an_web", "raul_fraile_ladybug", "web_profiler", "sensio_distribution"

Search over this and told me that was to install the Bundle

https://github.com/stof/StofDoctrineExtensionsBundle/blob/master/Resources/doc/index.rst

installed ... and my config.yml so (this is the only thing that changes)

sylius_product:
    driver: doctrine/orm # Configure the doctrine orm driver used in the documentation.
#CHANGE
stof_doctrine_extensions:
    default_locale: es_us
    translation_fallback: true
    orm:
        default:
            tree: true

And now I have this other error: (

InvalidConfigurationException: The child node "classes" at path "sylius_product" must be configured.

thank you very much

Solution:

Replace and place in the config.yml

sylius_product:
    driver: doctrine/orm
    classes:
        product:
            model: Sylius\Bundle\CoreBundle\Model\Product
            controller: Sylius\Bundle\CoreBundle\Controller\ProductController
            repository: Sylius\Bundle\CoreBundle\Repository\ProductRepository
            form: Sylius\Bundle\CoreBundle\Form\Type\ProductType

Thank you very much @stloyd !!

Was it helpful?

Solution

To fix this problem you need to use latest version of doctrine/doctrine-bundle, just update your composer.json with following code:

"require": {
    // ...
    "doctrine/doctrine-bundle": "1.2.*@dev",
},
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top