title: Error installing Symfony2 CMF
body: <p>When I try to access /cms/simple/contact (or any other path from phpcr_nodes table) I get the following error:</p>
  
  <pre><code>Notice: Undefined offset: 0 in /home/xx/xx/xx/public_html/vendor/symfony/symfony/src/Symfony/Component/Routing/RouteCompiler.php line 169 
  </code></pre>
  
  <p>First off, I'm not using Symfony CMF as a standalone, but only as a small part of a much larger project. We need WYSIWYG page editing by end users for <em>some</em> of the pages. </p>
  
  <p>Some of the configs:</p>
  
  <p>composer.json</p>
  
  <pre><code>"require": {
      "php": "&gt;=5.3.3",
      "symfony/symfony": "2.3.*",
      "doctrine/orm": "2.3.*",
      "doctrine/doctrine-bundle": "1.2.*",
      "twig/extensions": "1.0.*",
      "symfony/assetic-bundle": "2.3.*",
      "symfony/swiftmailer-bundle": "2.3.*",
      "symfony/monolog-bundle": "2.3.*",
      "sensio/distribution-bundle": "2.3.*",
      "sensio/framework-extra-bundle": "2.3.*",
      "sensio/generator-bundle": "2.3.*",
      "incenteev/composer-parameter-handler": "~2.0",
      "ircmaxell/password-compat": "1.0.*",
      "sonata-project/seo-bundle": "1.1.*",
      "leaseweb/memcache-bundle": "*",
      "facebook/php-sdk" : "3.2.*",
      "phpunit/dbunit": "&gt;=1.2",
      "symfony-cmf/symfony-cmf": "1.0.*",
      "symfony-cmf/simple-cms-bundle": "1.0.*",
      "symfony-cmf/create-bundle": "1.0.*",
      "jackalope/jackalope-doctrine-dbal": "1.0.*",
      "doctrine/data-fixtures": "1.0.*",
      "lunetics/locale-bundle": "2.2.*",
      "liip/doctrine-cache-bundle": "1.0.*",
      "liip/imagine-bundle": "~0.12",
      "wjzijderveld/check-bundles": "1.0.*@dev",
      "doctrine/phpcr-bundle": "1.0.*",
      "doctrine/phpcr-odm": "1.0.*",
      "sonata-project/doctrine-phpcr-admin-bundle": "1.0.*"
  },
  </code></pre>
  
  <p>App Kernel:</p>
  
  <pre><code>        new Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(),
          new Liip\DoctrineCacheBundle\LiipDoctrineCacheBundle(),
          new Knp\Bundle\MenuBundle\KnpMenuBundle(),
          new Lunetics\LocaleBundle\LuneticsLocaleBundle(),
          new FOS\RestBundle\FOSRestBundle(),
          new JMS\SerializerBundle\JMSSerializerBundle($this),
          new Liip\ImagineBundle\LiipImagineBundle(),
  
          // enable cmf bundles
          new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
          new Symfony\Cmf\Bundle\CoreBundle\CmfCoreBundle(),
          new Symfony\Cmf\Bundle\MenuBundle\CmfMenuBundle(),
          new Symfony\Cmf\Bundle\ContentBundle\CmfContentBundle(),
          new Symfony\Cmf\Bundle\SimpleCmsBundle\CmfSimpleCmsBundle(),
          new Symfony\Cmf\Bundle\MediaBundle\CmfMediaBundle(),
          new Symfony\Cmf\Bundle\CreateBundle\CmfCreateBundle(),
  
          // support for the admin
          new Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle(),
          new Sonata\jQueryBundle\SonatajQueryBundle(),
          new Sonata\BlockBundle\SonataBlockBundle(),
          new Sonata\AdminBundle\SonataAdminBundle(),
          new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(),
          new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
  </code></pre>
  
  <p>config.yml</p>
  
  <pre><code>doctrine_phpcr:
      # configure the PHPCR session
      session:
          backend: %phpcr_backend%
          workspace: %phpcr_workspace%
          username: %phpcr_user%
          password: %phpcr_pass%
      # enable the ODM layer
      odm:
          auto_mapping: true
          auto_generate_proxy_classes: %kernel.debug%
          locales:
              en:
                  - rs
  
  liip_doctrine_cache:
      namespaces:
          meta:
              type: file_system
          nodes:
              type: file_system
  
  cmf_core:
      persistence:
          phpcr:
              enabled: true
              basepath: /cms
      publish_workflow:
          enabled: false
      multilang:
          locales: %locales%
  
  cmf_create:
      editor_base_path: /bundles/cmfcreate/vendor/ckeditor/
  
  cmf_simple_cms:
      routing:
          templates_by_class:
              Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page: CmfSimpleCmsBundle:Page:index.html.twig
          controllers_by_class:
              Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute: cmf_routing.redirect_controller:redirectAction
  
  knp_menu:
      twig: true
  
  lunetics_locale:
      strict_mode: true
      guessing_order:
          - cookie
          - router
          - browser
      allowed_locales: %locales%
  
  sonata_block:
      default_contexts: [cms]
      blocks:
          sonata.admin.block.admin_list:
              contexts:   [admin]
          sonata_admin_doctrine_phpcr.tree_block:
              settings:
                  id: '/cms'
              contexts:   [admin]
  
  cmf_routing:
      chain:
          routers_by_id:
              cmf_routing.dynamic_router: 200
              router.default: 100
      dynamic:
          enabled: true
  
  sonata_admin:
      templates:
          # default global templates
          ajax:    SonataAdminBundle::ajax_layout.html.twig
      dashboard:
          blocks:
              # display a dashboard block
              - { position: right, type: sonata.admin.block.admin_list }
              - { position: left, type: sonata_admin_doctrine_phpcr.tree_block }
  
  sonata_doctrine_phpcr_admin:
      document_tree:
          Doctrine\ODM\PHPCR\Document\Generic:
              valid_children:
                  - all
          # if you are using the SimpleCmsBundle, enable the Page as well
          Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page:
               valid_children:
                   - all
          Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent:
              valid_children:
                  - all
          Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route:
              valid_children:
                  - Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route
                  - Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute
          Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute:
              valid_children: []
          Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode:
              valid_children:
                  - Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode
  </code></pre>
  
  <p>routing.yml</p>
  
  <pre><code>cmf_create_rest:
      resource: "@CmfCreateBundle/Resources/config/routing/rest.xml"
  
  cmf_create_image:
      resource: "@CmfCreateBundle/Resources/config/routing/image.xml"
  
  admin:
      resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
      prefix: /admin
  
  sonata_admin:
      resource: .
      type: sonata_admin
      prefix: /admin
  
  fos_js_routing:
      resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"
  
  cmf_tree:
      resource: .
      type: 'cmf_tree'
  </code></pre>
  
  <p>I also did</p>
  
  <pre><code>$ php composer.phar update
  $ php app/console doctrine:phpcr:init:dbal
  $ php app/console doctrine:phpcr:repository:init
  $ php app/console doctrine:phpcr:fixtures:load --append
  </code></pre>
  
  <p>(Append because I'm certainly not going to delete the existing data)</p>
  
  <p>I checked the database and the phpcr_nodes contains appropriate data. I also did var_dumps couple steps before the RouteCompiler gets called and the data from the DB is indeed being loaded properly. </p>
  
  <p>What am I missing?</p>