Sylius / Sylius

Open Source eCommerce Framework on Symfony
https://sylius.com
MIT License
7.85k stars 2.08k forks source link

[TaxonomyBundle] Fatal error creating taxonomy #3114

Closed steveWinter closed 9 years ago

steveWinter commented 9 years ago

Hi

I've installed the taxonomy bundle as described at: http://docs.sylius.org/en/latest/bundles/SyliusTaxonomyBundle/installation.html (though I also had to manually add the SyliusTranslationBundle).

Everything appears to be configured correctly (though I can't locate any documentation for the SyliusTranslationBundle).

When I try to follow the example given in the docs:

$repository = $this->container->get('sylius.repository.taxonomy');
$manager = $this->container->get('sylius.manager.taxonomy'); 
$taxonomy = $repository->createNew();
$taxonomy->setName('Foo');
$manager->persist($taxonomy);
$manager->flush(); // Save changes in database.

I receive the following error:

Error: Call to a member function setCurrentLocale() on a non-object" at /Library/WebServer/Documents/OAG QSMS/src/vendor/sylius/taxonomy/Model/Taxonomy.php line 70

Any guidance would be greatly appreciated.

mojzis commented 9 years ago

Looks like that line has changed since, try getting the master branch ...

pjedrzejewski commented 9 years ago

@steveWinter Have you tried it again, can this be closed?

steveWinter commented 9 years ago

So I try and use dev-master with:

"require": {
   ...
        "sylius/taxonomy-bundle": "dev-master",
   ...
    },

Which results in:

Problem 1

  • Installation request for sylius/taxonomy-bundle dev-master -> satisfiable by sylius/taxonomy-bundle[dev-master].
  • sylius/taxonomy-bundle dev-master requires sylius/resource-bundle 0.15.*@dev -> no matching package found.

No matter how I try to combine versions with either dev-master or ~0.15@dev for taxonomy-bundle and resource-bundle I keep running into unresolvable dependencies, e.g.:

Problem 1

  • Installation request for sylius/resource-bundle dev-master -> satisfiable by sylius/resource-bundle[dev-master].
  • sylius/resource-bundle dev-master requires sylius/resource 0.15.*@dev -> no matching package found.

Problem 2

  • Installation request for sylius/taxonomy-bundle dev-master -> satisfiable by sylius/taxonomy-bundle[dev-master].
  • sylius/taxonomy-bundle dev-master requires sylius/taxonomy 0.15.*@dev -> no matching package found.

Problem 3

  • sylius/translation-bundle v0.14.0 requires sylius/resource-bundle 0.14.*@dev -> no matching package found.
  • sylius/translation-bundle v0.14.0 requires sylius/resource-bundle 0.14.*@dev -> no matching package found.
  • Installation request for sylius/translation-bundle ^0.14.0 -> satisfiable by sylius/translation-bundle[v0.14.0].

I've given up - the only aspect of the sylius 'framework' which I wanted was the taxonomy bundle for ease of managing taxonomy in an unrelated project, but at this point it's going to be easier to build something into the main application that's being developed.

pjedrzejewski commented 9 years ago

If you install dev version, you need to explicitly require all other packages, which are not stable. Eventually, you can change minimum stability to dev, but this is not recommended. Documentation should mention 0.14.0 probably. We will soon release 0.15.0 and make sure all bundles/components install properly on this version.