symfony-cmf / simple-cms-bundle

UNMAINTAINED - A more-than-simple cms based on the cmf components
http://cmf.symfony.com/
49 stars 45 forks source link

ParameterNotFoundException in RegisterMappingsPass.php line 237: #157

Closed speeeeeed2006 closed 8 years ago

speeeeeed2006 commented 8 years ago

I try to install the bundle I already added in my composer.json

       "jackalope/jackalope-doctrine-dbal": "1.2.*",
        "doctrine/phpcr-odm": "1.2.*",
        "doctrine/phpcr-bundle": "1.2.*",

I have made all the configuration in this page http://symfony.com/doc/master/cmf/bundles/phpcr_odm/introduction.html but I still have the same error. can someone tell me how to properly correct this error. Thanks

wouterj commented 8 years ago

Can you please show the cmf_simple_cms and (if available) the cmf_core entries in config.yml?

speeeeeed2006 commented 8 years ago

I didn't configure cmf_core in config because I don't use I just use cmf_simple_cms config:

cmf_simple_cms:
    persistence:
        phpcr:
            enabled:          false
            basepath:         /cms/simple
            manager_registry: doctrine_phpcr
            manager_name:     ~
            document_class:   Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page
            use_sonata_admin: auto
            sonata_admin:
                sort: false

when I use cmf_core I add to config

cmf_core:
    persistence:
        phpcr:
            enabled: true

but I still the same error.

here what I have in appKernel.php

 new Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Symfony\Cmf\Bundle\MenuBundle\CmfMenuBundle(),
new Symfony\Cmf\Bundle\ContentBundle\CmfContentBundle(),
new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
new Symfony\Cmf\Bundle\SimpleCmsBundle\CmfSimpleCmsBundle(),

if I use cmfCore I add

new \Symfony\Cmf\Bundle\CoreBundle\CmfCoreBundle(),
speeeeeed2006 commented 8 years ago

I change some stuff and I used in config.iml:

cmf_core:
    persistence:
        orm:
            enabled:          false
            manager_name:     ~
            use_sonata_admin: auto

cmf_simple_cms:
    persistence:
        phpcr:
            enabled:          false
            basepath:         /cms/simple
            manager_registry: doctrine_phpcr
            manager_name:     ~
            document_class:   Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page
            use_sonata_admin: auto
            sonata_admin:
                sort: false

in appKernel.php

new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Symfony\Cmf\Bundle\MenuBundle\CmfMenuBundle(),
new \Symfony\Cmf\Bundle\CoreBundle\CmfCoreBundle(),
new Symfony\Cmf\Bundle\ContentBundle\CmfContentBundle(),
new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
new Symfony\Cmf\Bundle\SimpleCmsBundle\CmfSimpleCmsBundle(),

in composer.json

"jackalope/jackalope-doctrine-dbal": "1.2.*",
"doctrine/phpcr-odm": "1.2.*",
"doctrine/phpcr-bundle": "1.2.*",
"symfony-cmf/simple-cms-bundle": "1.3.*@dev",
"symfony-cmf/core-bundle":"1.3.*@dev"

but I have another error :

InvalidConfigurationException in CmfRoutingExtension.php line 130:
When the dynamic router is enabled, you need to either enable one of the persistence layers or set the cmf_routing.dynamic.route_provider_service_id option
dbu commented 8 years ago

well, as the exception message says, you need to enable one of the persistence layers (orm or phpcr) or write your own route provider. the configuration of the core bundle is prepended to the routing configuration, so enabling orm or phpcr there will help. with what you copied, you disable orm explicitly and don't enable phpcr.

you need this configuration

cmf_core:
    persistence:
        phpcr:
            enabled: true

and you need to instantiate the Core, Routing and SimpleCms bundles in your kernel.

speeeeeed2006 commented 8 years ago

when I change it I have the first error:

ParameterNotFoundException in RegisterMappingsPass.php line 237:
You have requested a non-existent parameter "Could not determine the Doctrine manager. Either Doctrine is not configured or a bundle is misconfigured.".

in case I also tried the orm : If I have understand I have to use phpcr, can I use orm by changing it to :

cmf_core:
    persistence:
        orm:
            enabled: true

but I have the same probleme. error "ParameterNotFoundException in RegisterMappingsPass.php line 237:"

dbu commented 8 years ago

the exception says "Either Doctrine is not configured or a bundle is misconfigured". do you configure phpcr_odm and instantiate the DoctrinePhpcrBundle in AppKernel? if not, this is probably the reason for the error.

wouterj commented 8 years ago

First of all, I don't understand much of your config. You disable PHPCR, but then you still configure almost all options available. That seems quite strange.

Next, you set manager_name to ~ (null). That's not correct, as it has to contain the name of the object manager of Doctrine (probably default).

At last, you enable only orm support. The CMF does not support ORM yet (except from the CmfRoutingBundle). So I suggest you to use PHPCR or build your own content entity.

(please note that this bundle is only going to have legacy support, there will be no new minor/major releases of this bundle).

speeeeeed2006 commented 8 years ago

Sorry to reply late thank you for the help I will try to make it work.

dbu commented 8 years ago

@speeeeeed2006 no worries. i am optimistic that we can figure it out together. there are many different things going together for the simple cms bundle, easy to miss something.

maybe a good starting point for you could be https://github.com/symfony-cmf/standard-edition which already sets up phpcr-odm and the cmf, just not simple cms. but it should be easier adding simple cms there when the rest already works.

speeeeeed2006 commented 8 years ago

Yeah I have maybe to add CMF to my project and start from that point. After adding simpleCms will easier. Thanks ! I will be back to give the result.

julien-maitan commented 8 years ago

The core_bundle is not require but when it's enabled, phpcr configuration is provided for a lot of bundle using it, like SimpleCMS. I tried to install the RoutingBundle and add the same error. To fix it, I added the ODM configuration to doctrine_phpcr, like this in config.yml:

doctrine_phpcr:
    odm: ~

You can get the configuration reference from http://symfony.com/doc/current/cmf/bundles/phpcr_odm/configuration.html

A bit late, but hope this will help.

dbu commented 8 years ago

thanks for the clarification @julien-maitan