DieSchittigs / contao-content-api-bundle

Contao JSON-API
MIT License
41 stars 9 forks source link

Contao 4.4.1: Uncaught LogicException: setProjectDir() must be called to initialize the ContaoKernel. #4

Closed informatikTirol closed 7 years ago

informatikTirol commented 7 years ago

HI, I get the following error: Fatal error: Uncaught LogicException: setProjectDir() must be called to initialize the ContaoKernel. in /vendor/contao/manager-bundle/src/HttpKernel/ContaoKernel.php on line 64

Here ist the Call Stack

'

1 | 0.0014 | 363128 | {main}( ) | .../api.php:0 2 | 0.0116 | 1016000 | DieSchittigs\ContaoContentApi\FrontendApi->construct( ) | .../api.php:12 3 | 0.0158 | 1323568 | Symfony\Component\HttpKernel\Kernel->construct( ) | .../FrontendApi.php:28 4 | 0.0158 | 1323568 | Contao\ManagerBundle\HttpKernel\ContaoKernel->getRootDir( ) | .../Kernel.php:84 5 | 0.0159 | 1323568 | Contao\ManagerBundle\HttpKernel\ContaoKernel->getProjectDir( ) | .../ContaoKernel.php:76 `

Installed via composer, got no error...

Thank you for your help!

informatikTirol commented 7 years ago

When in replace FrontendApi Line 30 $kernel->setRootDir(dirname(DIR).'/app'); with ContaoKernel::setProjectDir(dirname(DIR).'/app');

on line 28, this problem is solved. Then i get

Fatal error: Uncaught InvalidArgumentException: Composer installed.json was not found at ".../vendor/dieschittigs/contao-content-api/app/vendor/composer/installed.json" in .../vendor/contao/manager-plugin/src/PluginLoader.php on line 134

saibotd commented 7 years ago

Thanks for the report! Must be something with the latest Contao Version, I'll look into it

saibotd commented 7 years ago

I'm currently migrating the code into a Symfony Bundle. This should be fixed with the next release