I recently updated my symfony2 project sellers. So I got the latest version of the Sonata Admin Bundle (updated from 2.2.5 to 2.2.6).
I saw that there is a new search feature in this release, but I can't get it to work. I cannot understand what I am doing wrong. It infuriates me.
Here is my composer .json requires:
"require": { "php": ">=5.3.3", "symfony/symfony": "2.3.*", "doctrine/orm": ">=2.2.3,<2.4-dev", "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", "jms/security-extra-bundle": "1.5.*", "doctrine/data-fixtures": "1.0.*", "doctrine/doctrine-fixtures-bundle": "dev-master", "doctrine/migrations": "dev-master", "doctrine/doctrine-migrations-bundle": "dev-master", "stof/doctrine-extensions-bundle": "1.1.*", "friendsofsymfony/user-bundle" : "1.3.*", "knplabs/knp-menu-bundle": "1.1.*", "knplabs/gaufrette": "dev-master", "knplabs/knp-paginator-bundle": "2.3.*", "sonata-project/easy-extends-bundle" : "2.1.*", "sonata-project/cache-bundle": "2.1.*", "sonata-project/jquery-bundle": "1.8.*", "sonata-project/exporter": "1.3.*", "sonata-project/block-bundle": "2.2.*", "sonata-project/user-bundle": "2.2.*@dev", "sonata-project/admin-bundle": "2.2.*", "sonata-project/doctrine-orm-admin-bundle": "2.2.*", "sonata-project/doctrine-extensions": "1.0.0", "sonata-project/google-authenticator": "1.0.0", "sonata-project/intl-bundle": "2.2.*@dev", "sonata-project/media-bundle": "2.2.*", "sonata-project/notification-bundle": "2.2.*", "sonata-project/formatter-bundle": "2.3.*", "hwi/oauth-bundle": "0.3.*@dev", "elao/web-profiler-extra-bundle": "2.3.*@dev", "liip/functional-test-bundle": "dev-master", "guzzle/guzzle": "v3.4.1", "jms/serializer-bundle": "0.12.*@dev", "friendsofsymfony/rest-bundle": "0.12.0", "friendsofsymfony/comment-bundle": "2.0.*@dev", "whiteoctober/breadcrumbs-bundle": "dev-master", "igorw/file-serve-bundle": "1.0.*", "zendframework/zendpdf": "2.0.*" },
Right after the update, I had a search function complaining about a non-existent block:
An exception has been thrown during the rendering of a template ("The block type sonata.admin.block.search_result does not exist") in SonataAdminBundle:Core:search.html.twig at line 48
I fixed this by declaring a block in my config.yml:
sonata_block: default_contexts: [cms] blocks: sonata.admin.block.admin_list: contexts: [admin] sonata.admin.block.search_result: contexts: [admin] sonata.block.service.text: sonata.block.service.rss:
But now he complains that the request has not been set:
An exception has been thrown during the rendering of a template ("The Request object has not been set") in SonataAdminBundle:Core:search.html.twig at line 48
I really don't understand what I'm missing here. Any help would be greatly appreciated.