Lakion / CmsPlugin

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

Error when creating a block with an image #35

Closed relte closed 7 years ago

relte commented 7 years ago

The following error occurs when trying to create a block with an image:

The class 'Symfony\Cmf\Bundle\MediaBundle\Doctrine\Phpcr\Image' was not found in the chain configured namespaces FOS\OAuthServerBundle\Document, Doctrine\ODM\PHPCR\Document, Lakion\SyliusCmsBundle\Document, Symfony\Cmf\Bundle\BlockBundle\Model, Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr, Symfony\Cmf\Bundle\ContentBundle\Model, Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr, Symfony\Cmf\Bundle\MenuBundle\Model, Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr, Symfony\Component\Routing, Symfony\Cmf\Bundle\RoutingBundle\Model, Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr

pamil commented 7 years ago

It's caused by https://github.com/symfony-cmf/block-bundle/pull/274.

We need to revert that PR in our repository.

ghost commented 7 years ago

@pamil, actually it's not a problem. I tried to install the previous version of symfony-cmf/block bundle (the 2.0.0-RC1) and it caused the same result. The error is thrown because of missing new \Symfony\Cmf\Bundle\MediaBundle\CmfMediaBundle() declaration in AppKernel.php file. There are also few routing files that are required for this bundle:

#shop_routing.yml:
...
cmf_media_file:
    resource: "@CmfMediaBundle/Resources/config/routing/file.xml"

cmf_media_image:
    resource: "@CmfMediaBundle/Resources/config/routing/image.xml"

_liip_imagine:
    resource: "@LiipImagineBundle/Resources/config/routing.xml"

To make things work together phpcr repository has to be initialized once again:

bin/console doctrine:phpcr:repository:init

Unfortunately the CmfMediaBundle is no longer maintained which can cause more issues in future develompent.

kochen commented 7 years ago

This issue still exists.

kochen commented 7 years ago

@michalmarcinkowski, @pamil, Any chance for anyone to re-review this?