silexphp / Silex-WebProfiler

MIT License
210 stars 61 forks source link

Neither the property "redirect" in @WebProfiler/Profiler/layout.html.twig #94

Closed k20human closed 8 years ago

k20human commented 8 years ago

Hi,

I just update to Silex 2.0 and i have a bug with the WebProfiler. I can access to my web page but the profiler wont load and throw this error:

Twig_Error_Runtime in Template.php line 590: Neither the property "redirect" nor one of the methods "redirect()", "getredirect()"/"isredirect()" or "__call()" exist and have public access in class "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector" in "@WebProfiler/Profiler/layout.html.twig" at line 23

Here is my composer.json

{
    "name": "",
    "description": "A pre-configured skeleton for the Silex microframework with Grunt tasks added",
    "license": "Copyright",
    "type": "project",
    "require": {
        "php": ">=5.6",
        "silex/silex": "~2.0",
        "silex/web-profiler": "^2.0",
        "symfony/class-loader": "^2.8",
        "symfony/config": "^3.0",
        "symfony/console": "~2.8",
        "symfony/debug": "~2.8",
        "symfony/finder": "~2.8",
        "symfony/form": "~2.8",
        "symfony/monolog-bridge": "~2.8",
        "symfony/process": "~2.8",
        "symfony/security": "~2.8",
        "symfony/translation": "~2.8",
        "symfony/twig-bridge": "~2.8",
        "symfony/validator": "~2.8",
        "symfony/http-kernel": "^2.8",
        "twig/extensions": "^1.3",
        "doctrine/dbal": "~2.2",
        "pimple/pimple": "~3.0",
        "dflydev/doctrine-orm-service-provider": "~2.0",
        "symfony/serializer": "^3.0",
        "swiftmailer/swiftmailer": "^5.4",
        "gedmo/doctrine-extensions": "v2.4.13",
        "symfony/yaml": "^2.8",
        "symfony/routing": "^2.8",
        "jms/serializer": "^1.1",
        "cnam/security-jwt-service-provider": "dev-master",
    "m1/vars": "dev-silex-v2"
    },
    "autoload": {
        "psr-0": {
            "": "src/"
        }
    }
}

Do you have any idea ?

k20human commented 8 years ago

For information if i use Symfony 3.0 it's work ...

HeahDude commented 8 years ago

I think you should try to upgrade the symfony/http-kernel to 3.1 accordingly to the WebProfilerBundle (which may cause a conflict here), maybe by using symfony/http-kernel: ~3.0 in your composer.json.

HeahDude commented 8 years ago

I've opened https://github.com/symfony/symfony/pull/19159.

rwitchell commented 6 years ago

make sure all of your symfony packages are on ~2.8, check your composer.lock and see if any packages have downloaded as v3+. I had the same issue, and it turns out symfony/web-profiler-bundle was 3.1.1 and symfony/dependency-injection was also 3.1.10