JMSJobQueueBundle icon indicating copy to clipboard operation
JMSJobQueueBundle copied to clipboard

symfony flex support - Call to a member function has() on null

Open Asia321 opened this issue 7 years ago • 3 comments

My project is based on symfony 3.4 and flex after instalation of JMSJobQueueBundle all the controllers extending Symfony\Bundle\FrameworkBundle\Controller\Controller stopped to work - there is no container injected into them, so we get errors: 'Call to a member function has() on null' or 'Call to a member function get() on null', dependent on what kind of container operation we want to do. Easy to reproduce: composer.json

"require": {
        "php": "^7.0.8",
        "doctrine/doctrine-bundle": "^1.8",
        "doctrine/orm": "^2.6",
        "jms/job-queue-bundle": "^1.4",
        "symfony/console": "^3.4",
        "symfony/flex": "^1.0",
        "symfony/form": "^3.4",
        "symfony/framework-bundle": "^3.4",
        "symfony/lts": "^3",
        "symfony/translation": "^3.4",
        "symfony/twig-bundle": "^3.4",
        "symfony/validator": "^3.4",
        "symfony/yaml": "^3.4"
 }

and create simple controller using container eg. renders twig template

Asia321 avatar Feb 09 '18 10:02 Asia321

Did you find any solution?

gewooneendeveloper avatar Feb 27 '18 08:02 gewooneendeveloper

My solution for now is: Remove the new JMS\DiExtraBundle\JMSDiExtraBundle() from the $bundles in AppKernel.php

gewooneendeveloper avatar Feb 27 '18 08:02 gewooneendeveloper

Yes, the problem is that bundle: there are many issues opened about this issue, both on JSDiEXtra bundle page and on the Symfony's one. The first is about seven months old, but nothing were done and problem still exists...

Aerendir avatar Feb 27 '18 09:02 Aerendir