Provider updates hacked the FOS User Bundle using "Calling a has () member function for a non-object"

I updated my providers for the Symfony 2.8 project and suddenly the login page does not load - instead, I get the following:

Error: a call to a member function has () for a non-object in the provider / Symfony / Symfony / SRC / Symfony / Bundle / FrameworkBundle / Controller / controller.php on line 184

"name": "hazardlog",
"license": "proprietary",
"type": "project",
"autoload": {
    "psr-4": {
        "": "src/"
    },
    "classmap": [
        "app/AppKernel.php",
        "app/AppCache.php"
    ]
},
"repositories": [
    {
        "type": "package",
        "package": {
            "name": "jquery/jquery",
            "version": "1.11.1",
            "dist": {
                "url": "https://code.jquery.com/jquery-1.11.1.js",
                "type": "file"
            }
        }
    }
],
"require": {
    "php": ">=5.3.9",
    "symfony/symfony": "2.8.*",
    "doctrine/orm": "^2.4.8",
    "doctrine/doctrine-bundle": "~1.4",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~5.0",
    "sensio/framework-extra-bundle": "^3.0.2",
    "incenteev/composer-parameter-handler": "~2.0",
    "braincrafted/bootstrap-bundle": "~2.0",
    "twbs/bootstrap": "3.0.*",
    "jquery/jquery":  "1.11.*",
    "hwi/oauth-bundle": "^0.5.0",
    "friendsofsymfony/user-bundle": "~2.0@dev",
    "stephanecollot/datetimepicker-bundle": "dev-master"
},
"require-dev": {
    "sensio/generator-bundle": "~3.0",
    "symfony/phpunit-bridge": "~2.7"
},
"scripts": {
    "symfony-scripts": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
    ],
    "post-install-cmd": [
        "@symfony-scripts"
    ],
    "post-update-cmd": [
        "@symfony-scripts"
    ]
},
"config": {
    "bin-dir": "bin"
},
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "symfony-assets-install": "relative",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    }
}
+4
source share
5 answers

I saw this question several times, but I could not find it with the accepted answer and explanation. So here.

The main problem is as follows:

"friendsofsymfony/user-bundle": "~2.0@dev",

, Symfony 2.8/3.0 , FOSUserBundle 1.x . 2.x , . , . , , , , , , .

, 2.x FOSUserBundle. , .

. Symfony 4 -. , 2.8 (, , 3.0).

:

"friendsofsymfony/user-bundle": "~2.0",

.

+7

, - composer.json

"friendsofsymfony/user-bundle": "~2.0",

:

: - () /symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php 184

0

, Symfony 3.2, , "~ 2.1" OP "~2.0@dev".

:

"friendsofsymfony/user-bundle": "2.0"

2.0 .

0

, @dev ( )

:

in vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Controller\Controller.php at line 234
0

, , , . :

"friendsofsymfony/user-bundle": "^2.1",

composer.json, -, () , . "@dev":

"friendsofsymfony/user-bundle": "^2.1@dev",

0

Source: https://habr.com/ru/post/1691879/


All Articles