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

ServiceNotFoundException on "sonata.admin.route.path_info_slashes" #6

Closed Bendihossan closed 12 years ago

Bendihossan commented 12 years ago

I get the following on install:

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]                                                          
  The service "symfony_cmf_simple_cms.admin.page" has a dependency on a non-existent service "sonata.admin.route.path_info_slashes".  

My composer.json:

    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "dev-master",
        "twig/extensions": "dev-master",
        "symfony/assetic-bundle": "dev-master",
        "symfony/swiftmailer-bundle": "dev-master",
        "symfony/monolog-bundle": "dev-master",
        "sensio/distribution-bundle": "dev-master",
        "sensio/framework-extra-bundle": "dev-master",
        "sensio/generator-bundle": "dev-master",
        "jms/security-extra-bundle": "1.2.*",
        "jms/di-extra-bundle": "1.1.x-dev",
        "symfony-cmf/core-bundle": "dev-master",
        "symfony-cmf/simple-cms-bundle": "dev-master",
        "symfony-cmf/routing-extra-bundle": "dev-master",
        "symfony-cmf/menu-bundle": "dev-master",
        "symfony-cmf/multilang-content-bundle": "dev-master",
        "sonata-project/block-bundle": "dev-master",
        "sonata-project/admin-bundle": "dev-master"
    },
#app/config/config.yml 
symfony_cmf_menu:
    document_manager_name: default

symfony_cmf_routing_extra:
    chain:
        routers_by_id:
            # enable the DynamicRouter with high priority to allow overwriting configured routes with content
            symfony_cmf_routing_extra.dynamic_router: 200
            # enable the symfony default router with a lower priority
            router.default: 100
        # whether the chain router should replace the default router. defaults to true
        # if you set this to false, the router is just available as service
        # symfony_cmf_routing_extra.router and you  need to do somthing to trigger it
        # replace_symfony_router: true
    dynamic:
        enabled: true
        generic_controller: symfony_cmf_content.controller:indexAction
        controllers_by_alias:
            editablestatic: sandbox_main.controller:indexAction
        controllers_by_class:
            Symfony\Cmf\Bundle\ContentBundle\Document\StaticContent: symfony_cmf_content.controller::indexAction
        templates_by_class:
            Symfony\Cmf\Bundle\ContentBundle\Document\StaticContent: SymfonyCmfContentBundle:StaticContent:index.html.twig

        # the repository is responsible to load routes
        # for phpcr-odm, we mainly use this because it can map from url to repository path
        # an orm repository might need different logic. look at cmf_routing.xml for an example if you
        # need to define your own service
        manager_registry: doctrine_phpcr
        manager_name: default

        # if you use the default doctrine route repository servie, you can use this to customize
        # the root path for the phpcr-odm RouteRepository
        # this base path will be injected by the Listener\IdPrefix - but only to routes
        # matching the prefix, to allow for more than one route source.
        routing_repositoryroot: /cms/routes

symfony_cmf_simple_cms:
    routing:
        templates_by_class:
            Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page:    SymfonyCmfSimpleCmsBundle:Page:index.html.twig

sonata_block:
        default_contexts: [cms]
        blocks:
            sonata.admin.block.admin_list:
                contexts: [admin]

            sonata.block.service.text:
            sonata.block.service.action:
            sonata.block.service.rss:

This also happens if I do not use the Sonata Admin bundle:

#app/config/config.yml
symfony_cmf_simple_cms:
    use_sonata_admin: false

These are the references I can find to "sonata.admin.route.path_info_slashes" in the vendors

grep -r "sonata.admin.route.path_info_slashes" vendor/*
vendor/symfony-cmf/simple-cms-bundle/Symfony/Cmf/Bundle/SimpleCmsBundle/Resources/config/services/admin.xml:                <argument type="service" id="sonata.admin.route.path_info_slashes"/>
vendor/symfony-cmf/menu-bundle/Symfony/Cmf/Bundle/MenuBundle/Resources/config/menu-admin.xml:                <argument type="service" id="sonata.admin.route.path_info_slashes" />
dbu commented 12 years ago

You are missing the sonata phpcr admin, i just see the abstract base admin in your composer file. Which setup instructions did you use? Can you Pr to fix them?

----- Reply message ----- Von: "Steffan Harries" notifications@github.com An: "symfony-cmf/SimpleCmsBundle" SimpleCmsBundle@noreply.github.com Betreff: [SimpleCmsBundle] ServiceNotFoundException on "sonata.admin.route.path_info_slashes" (#6) Datum: Sa., Sep. 1, 2012 20:36 I get the following on install:

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "symfony_cmf_simple_cms.admin.page" has a dependency on a non-existent service "sonata.admin.route.path_info_slashes".

My composer.json:

"require": { "php": ">=5.3.3", "symfony/symfony": "2.1.", "doctrine/orm": ">=2.2.3,<2.4-dev", "doctrine/doctrine-bundle": "dev-master", "twig/extensions": "dev-master", "symfony/assetic-bundle": "dev-master", "symfony/swiftmailer-bundle": "dev-master", "symfony/monolog-bundle": "dev-master", "sensio/distribution-bundle": "dev-master", "sensio/framework-extra-bundle": "dev-master", "sensio/generator-bundle": "dev-master", "jms/security-extra-bundle": "1.2.", "jms/di-extra-bundle": "1.1.x-dev", "symfony-cmf/core-bundle": "dev-master", "symfony-cmf/simple-cms-bundle": "dev-master", "symfony-cmf/routing-extra-bundle": "dev-master", "symfony-cmf/menu-bundle": "dev-master", "symfony-cmf/multilang-content-bundle": "dev-master", "sonata-project/block-bundle": "dev-master", "sonata-project/admin-bundle": "dev-master" },

app/config/config.yml

symfony_cmf_menu: document_manager_name: default

symfony_cmf_routing_extra: chain: routers_by_id:

enable the DynamicRouter with high priority to allow overwriting configured routes with content

symfony_cmf_routing_extra.dynamic_router: 200

enable the symfony default router with a lower priority

router.default: 100

whether the chain router should replace the default router. defaults to true

if you set this to false, the router is just available as service

symfony_cmf_routing_extra.router and you need to do somthing to trigger it

replace_symfony_router: true

dynamic: enabled: true generic_controller: symfony_cmf_content.controller:indexAction controllers_by_alias: editablestatic: sandbox_main.controller:indexAction controllers_by_class: Symfony\Cmf\Bundle\ContentBundle\Document\StaticContent: symfony_cmf_content.controller::indexAction templates_by_class: Symfony\Cmf\Bundle\ContentBundle\Document\StaticContent: SymfonyCmfContentBundle:StaticContent:index.html.twig

the repository is responsible to load routes

for phpcr-odm, we mainly use this because it can map from url to repository path

an orm repository might need different logic. look at cmf_routing.xml for an example if you

need to define your own service

manager_registry: doctrine_phpcr manager_name: default

if you use the default doctrine route repository servie, you can use this to customize

the root path for the phpcr-odm RouteRepository

this base path will be injected by the Listener\IdPrefix - but only to routes

matching the prefix, to allow for more than one route source.

routing_repositoryroot: /cms/routes

symfony_cmf_simple_cms: routing: templates_by_class: Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page: SymfonyCmfSimpleCmsBundle:Page:index.html.twig

sonata_block: default_contexts: [cms] blocks: sonata.admin.block.admin_list: contexts: [admin]

sonata.block.service.text: sonata.block.service.action: sonata.block.service.rss:

This also happens if I do not use the Sonata Admin bundle:

app/config/config.yml

symfony_cmf_simple_cms: use_sonata_admin: false

These are the references I can find to "sonata.admin.route.path_info_slashes" in the vendors

grep -r "sonata.admin.route.path_info_slashes" vendor/* vendor/symfony-cmf/simple-cms-bundle/Symfony/Cmf/Bundle/SimpleCmsBundle/Resources/config/services/admin.xml: vendor/symfony-cmf/menu-bundle/Symfony/Cmf/Bundle/MenuBundle/Resources/config/menu-admin.xml:

Reply to this email directly or view it on GitHub.

Bendihossan commented 12 years ago

Thanks @dbu, that took care of that problem. The instructions I followed for SimpleCmsBundle were:

After installing doctrine-phpcr-admin-bundle I'm now getting a different error:

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]                                                             
  The service "symfony_cmf_multilang_content.language_selector_controller" has a dependency on a non-existent service "doctrine_phpcr".  

When I have a working build of the SimpleCmsBundle I'll write a doc on how to install it, it's dependencies and make a pull request.

lsmith77 commented 12 years ago

@Bendihossan you can send a PR with a fix to this repo https://github.com/symfony-cmf/symfony-cmf-docs

dbu commented 12 years ago

@Bendihossan doctrine_phpcr comes from vendor/doctrine/phpcr-bundle/Doctrine/Bundle/PHPCRBundle/Resources/config/phpcr.xml

did you add the doctrine phpcr bundle? from your composer.json i see you have doctrine orm, which you would not need for the cmf components. we currently do not have entities for the orm, only for doctrine phpcr.

Bendihossan commented 12 years ago

@dbu Yep, I've since added that and removed doctrine orm. I'm now at a point where I need to setup a repository so this issue can be closed now. Thanks for your help! :)

dbu commented 12 years ago

cool, you are welcome. if you have a PR to improve the setup instructions, would be great.