instride-ch / pimcore-data-definitions

Data Definitions Plugin for Pimcore
Other
77 stars 58 forks source link

Installation issue #44

Closed Yivan closed 6 years ago

Yivan commented 6 years ago

Installing with Pimcore 5.0.2 seems to lead to an error:

Fatal error: Class CoreShop\Bundle\ResourceBundle\Pimcore\PimcoreRepository cannot implement previously implemented interface CoreShop\Component\Resource\Repository\RepositoryInterface in .../web/vendor/coreshop/resource-bundle/Pimcore/PimcoreRepository.php on line 21

It seems there are some incompatibility between the 2 bundles for now.

dpfaffenbauer commented 6 years ago

Doesn't seem to happen to me, can you try running

composer update --with-dependencies

This should get you the latest version of coreshop libraries.

Yivan commented 6 years ago

Thanks for looking for it!

I tested by running composer update --with-dependencies but same error.

As i don't want to change the composer to dev minimal dependency to prevent some project breaks, I install each dependency like this:

composer require coreshop/registry ^2.0-dev@dev
composer require coreshop/resource ^2.0-dev@dev
composer require coreshop/resource-bundle ^2.0-dev@dev
composer require w-vision/import-definitions:^2.0-dev@dev
composer update --with-dependencies

After that, i add to AppKernel.php:

    $collection->addBundles(array(
        new \JMS\SerializerBundle\JMSSerializerBundle(),
        new \CoreShop\Bundle\ResourceBundle\CoreShopResourceBundle(),
        new \FOS\RestBundle\FOSRestBundle(),
        new \Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
        new \Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle()
    ), 120);

And after I run: bin/console pimcore:bundle:enable ImportDefinitionsBundle

And here come the error i give in my first post. Here a screen shoot (error is at the end, and it can be seen a warning json encoding in the middle of the process):

warning

Just if you need, running composer update --with-dependencies was ok:

with-dep

dpfaffenbauer commented 6 years ago

can you please check your composer.lock file for what version of coreshop/resource-bundle is installed?

Yivan commented 6 years ago

Here you will find the composer.json and composer.lock:

bug-composer.zip

Yivan commented 6 years ago

I can add that during composer require command, i get for:

composer require coreshop/registry ^2.0-dev@dev => dev-master 5c6a991

composer require coreshop/resource ^2.0-dev@dev => dev-master 65fb90e

composer require coreshop/resource-bundle ^2.0-dev@dev => see just below
  - Installing behat/transliterator (v1.2.0): Downloading (100%)
  - Installing gedmo/doctrine-extensions (v2.4.31): Downloading (100%)
  - Installing stof/doctrine-extensions-bundle (v1.2.2): Downloading (100%)       - Installing phpoption/phpoption (1.5.0): Downloading (100%)
  - Installing phpcollection/phpcollection (0.5.0): Downloading (100%)
  - Installing jms/parser-lib (1.0.0): Downloading (100%)
  - Installing jms/metadata (1.6.0): Downloading (100%)
  - Installing jms/serializer (1.9.1): Downloading (100%)
  - Installing jms/serializer-bundle (1.5.0): Downloading (100%)
  - Installing willdurand/jsonp-callback-validator (v1.1.0): Downloading (100%)   - Installing willdurand/negotiation (v2.3.1): Downloading (100%)
  - Installing friendsofsymfony/rest-bundle (2.2.0): Downloading (100%)
  - Installing doctrine/orm (v2.5.12): Downloading (100%)
  - Installing coreshop/resource-bundle (2.0.0-alpha.2): Downloading (100%) 

composer require w-vision/import-definitions:^2.0-dev@dev => dev-master 04e30bf

I hope it helps.

dpfaffenbauer commented 6 years ago

As I though, you are using an outdated version of resource-bundle.

As you can se here: https://github.com/coreshop/ResourceBundle/commits/master/Pimcore/PimcoreRepository.php, I fixed that bug. (I did a lot more in that commit) on 23rd June.

The commit sha1 your composer.lock refers to is from 10th June. Actually it is this commit (https://github.com/coreshop/ResourceBundle/commit/fe7eeb6ff6ed7a4bc811363927932c7d5a90c180)

Can you try installing the actual alpha-3 of all of these libs?

Yivan commented 6 years ago

Just to give more information too:

Yivan commented 6 years ago

I tried:

composer require coreshop/registry ^2.0.0-alpha.3@dev => nothing has been updated (already installed i think) composer require coreshop/resource ^2.0.0-alpha.3@dev => nothing has been updated (already installed i think)

composer require coreshop/resource-bundle ^2.0.0-alpha.3@dev Ouch this one seems to need all coreshop ? coreshop/resource-bundle 2.0.0-alpha.3 requires coreshop/pimcore ^2.0 -> satisfiable by coreshop/pimcore[2.0.0-alpha.3, 2.0.x-dev] Should I install coreshop ? (i don't really want because just the import plug in is necessary in my case)

EDIT: ha is it just some utilities https://github.com/coreshop/Pimcore I try now...

dpfaffenbauer commented 6 years ago

coreshop/pimcore are in fact just some utilities someone could need. CoreShop uses it for migration purposes.

Yivan commented 6 years ago

Ok installating went great!

Now there is another problem :)

All static asset aren't loaded... for instance: http://www.domain.com/bundles/importdefinitions/pimcore/js/startup.js send a 404 Same for all JS files form the plugin importdefinitions.

Looking on the file server, i got: /web/bundle/coreshopresource (a symlink) This symlink point to : /vendor/coreshop/resource-bundle/Resources/public wich contain just one directory pimcore-> js-> see tree here:

folder

dpfaffenbauer commented 6 years ago

please try

bin/console assets:install

Yivan commented 6 years ago

This last command do it! Thanks.

Just for curiosity, is it a Pimcore 5 command or specific to the importdefinitions bundle ? What is purpose of this command ? (is it documented ?)

Another side question on the subject. As I saw there was some symlink at some point (before running this command), does importdefinitions can be installed on Windows ?

dpfaffenbauer commented 6 years ago

Thats symfony, it copies the public resources into the web folder.

You can also symlink them by providing an argument --symlink (guess thats the symlink you saw).

I'll close this issue then.

Yivan commented 6 years ago

Tanks a lot @dpfaffenbauer for this fast support ! ; )

For future other user, maybe you could update the installation method, by giving another install option wich does not need to change minimal-stability for the all project. Finally all went ok by running those, so maybe it could be added to install documentation:

composer require coreshop/registry ^2.0.0-alpha.3@dev
composer require coreshop/resource ^2.0.0-alpha.3@dev
composer require coreshop/pimcore ^2.0.0-alpha.3@dev
composer require coreshop/resource-bundle ^2.0.0-alpha.3@dev
composer require w-vision/import-definitions:^2.0.0-alpha.3@dev
bin/console assets:install

It could be removed when stable will be out.

dpfaffenbauer commented 6 years ago

the min-stability will be removed anyway as soon as 2.0 of coreshop will be released.