schmittjoh / JMSJobQueueBundle

Run and Schedule Symfony Console Commands as Background Jobs
http://jmsyst.com/bundles/JMSJobQueueBundle
335 stars 254 forks source link

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

Open Asia321 opened 6 years ago

Asia321 commented 6 years ago

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

andreaswarnaar commented 6 years ago

Did you find any solution?

andreaswarnaar commented 6 years ago

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

Aerendir commented 6 years ago

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...