MetaModels / core

MetaModels Core Module
GNU Lesser General Public License v3.0
96 stars 42 forks source link

Undefined index notices when using contao-console debug:event-dispatcher #1327

Closed bezin closed 5 years ago

bezin commented 5 years ago

Checklist before I submit this issue report

I confirm that:

My environment is:

(Please fill in the actual values from your environment - check Contao Manager or use composer show)

Key Value Comments
PHP version: 7.2.2
Contao version: 4.4.41
MetaModels version: 2.1.4
Installed MetaModels packages: All
DCG version: 2.1.3

Issue description

Hi there,

when running the contao-console debug:event-dispatcher command, several notices occure:

Notice: Undefined index: TL_CONFIG in C:\dev\web\project\vendor\metamodels\core\src\Helper\ToolboxFile.php on line 205E

``` Call Stack: 0.2011 412528 1. {main}() C:\dev\web\project\vendor\contao\manager-bundle\bin\contao-console:0 0.2364 2935448 2. Symfony\Bundle\FrameworkBundle\Console\Application->run() C:\dev\web\project\vendor\contao\manager-bundle\bin\contao-console:47 0.2395 3094376 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:148 0.3103 8485192 4. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:74 0.3112 8505168 5. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:255 0.3112 8505168 6. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:86 0.3155 8766504 7. Symfony\Bundle\FrameworkBundle\Command\EventDispatcherDebugCommand->run() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:987 0.3157 8767520 8. Symfony\Bundle\FrameworkBundle\Command\EventDispatcherDebugCommand->execute() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command.php:255 0.3203 9299880 9. Symfony\Bundle\FrameworkBundle\Console\Helper\DescriptorHelper->describe() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Command\EventDispatcherDebugCommand.php:106 0.3203 9300256 10. Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor->describe() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Helper\DescriptorHelper.php:69 0.3203 9300256 11. Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor->describeEventDispatcherListeners() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Descriptor\Descriptor.php:72 0.3208 9300696 12. Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->getListeners() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor.php:403 0.3208 9300696 13. Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->getListeners() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher.php:128 0.4432 16233880 14. Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->sortListeners() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\EventDispatcher.php:69 0.4437 16269144 15. ContainerY5dxjnr\appProdProjectContainer->ContainerY5dxjnr\{closure}() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\EventDispatcher.php:229 0.4437 16269144 16. ContainerY5dxjnr\appProdProjectContainer->load() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1410 0.4439 16271184 17. require('C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeAdderService.php') C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1254 0.4441 16274944 18. ContainerY5dxjnr\appProdProjectContainer->load() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeAdderService.php:8 0.4443 16313976 19. require('C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFactoryService.php') C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1254 0.4483 16460600 20. ContainerY5dxjnr\appProdProjectContainer->load() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFactoryService.php:16 0.4484 16471240 21. require('C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFile_FactoryService.php') C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1254 0.4486 16545184 22. ContainerY5dxjnr\appProdProjectContainer->load() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFile_FactoryService.php:8 0.4488 16547312 23. require('C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFile_Toolbox_FileService.php') C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1254 0.4496 16659112 24. MetaModels\Helper\ToolboxFile->__construct() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFile_Toolbox_FileService.php:8 ```

Notice: Undefined index: TL_CONFIG in C:\dev\web\project\vendor\metamodels\core\src\Helper\ToolboxFile.php on line 224

``` Call Stack: 0.2011 412528 1. {main}() C:\dev\web\project\vendor\contao\manager-bundle\bin\contao-console:0 0.2364 2935448 2. Symfony\Bundle\FrameworkBundle\Console\Application->run() C:\dev\web\project\vendor\contao\manager-bundle\bin\contao-console:47 0.2395 3094376 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:148 0.3103 8485192 4. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:74 0.3112 8505168 5. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:255 0.3112 8505168 6. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:86 0.3155 8766504 7. Symfony\Bundle\FrameworkBundle\Command\EventDispatcherDebugCommand->run() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:987 0.3157 8767520 8. Symfony\Bundle\FrameworkBundle\Command\EventDispatcherDebugCommand->execute() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command.php:255 0.3203 9299880 9. Symfony\Bundle\FrameworkBundle\Console\Helper\DescriptorHelper->describe() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Command\EventDispatcherDebugCommand.php:106 0.3203 9300256 10. Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor->describe() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Helper\DescriptorHelper.php:69 0.3203 9300256 11. Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor->describeEventDispatcherListeners() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Descriptor\Descriptor.php:72 0.3208 9300696 12. Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->getListeners() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor.php:403 0.3208 9300696 13. Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->getListeners() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher.php:128 0.4432 16233880 14. Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->sortListeners() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\EventDispatcher.php:69 0.4437 16269144 15. ContainerY5dxjnr\appProdProjectContainer->ContainerY5dxjnr\{closure}() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\EventDispatcher.php:229 0.4437 16269144 16. ContainerY5dxjnr\appProdProjectContainer->load() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1410 0.4439 16271184 17. require('C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeAdderService.php') C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1254 0.4441 16274944 18. ContainerY5dxjnr\appProdProjectContainer->load() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeAdderService.php:8 0.4443 16313976 19. require('C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFactoryService.php') C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1254 0.4483 16460600 20. ContainerY5dxjnr\appProdProjectContainer->load() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFactoryService.php:16 0.4484 16471240 21. require('C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFile_FactoryService.php') C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1254 0.4486 16545184 22. ContainerY5dxjnr\appProdProjectContainer->load() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFile_FactoryService.php:8 0.4488 16547312 23. require('C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFile_Toolbox_FileService.php') C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1254 0.4496 16659112 24. MetaModels\Helper\ToolboxFile->__construct() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFile_Toolbox_FileService.php:8 0.9533 16795560 25. MetaModels\Helper\ToolboxFile->setAcceptedExtensions() C:\dev\web\project\vendor\metamodels\core\src\Helper\ToolboxFile.php:205 ```

Notice: Undefined variable: _SESSION in C:\dev\web\project\vendor\metamodels\core\src\Helper\ToolboxFile.php on line 206

``` Call Stack: 0.2011 412528 1. {main}() C:\dev\web\project\vendor\contao\manager-bundle\bin\contao-console:0 0.2364 2935448 2. Symfony\Bundle\FrameworkBundle\Console\Application->run() C:\dev\web\project\vendor\contao\manager-bundle\bin\contao-console:47 0.2395 3094376 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:148 0.3103 8485192 4. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:74 0.3112 8505168 5. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:255 0.3112 8505168 6. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:86 0.3155 8766504 7. Symfony\Bundle\FrameworkBundle\Command\EventDispatcherDebugCommand->run() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:987 0.3157 8767520 8. Symfony\Bundle\FrameworkBundle\Command\EventDispatcherDebugCommand->execute() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command.php:255 0.3203 9299880 9. Symfony\Bundle\FrameworkBundle\Console\Helper\DescriptorHelper->describe() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Command\EventDispatcherDebugCommand.php:106 0.3203 9300256 10. Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor->describe() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\Console\Helper\DescriptorHelper.php:69 0.3203 9300256 11. Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor->describeEventDispatcherListeners() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Descriptor\Descriptor.php:72 0.3208 9300696 12. Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->getListeners() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor.php:403 0.3208 9300696 13. Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->getListeners() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher.php:128 0.4432 16233880 14. Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->sortListeners() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\EventDispatcher.php:69 0.4437 16269144 15. ContainerY5dxjnr\appProdProjectContainer->ContainerY5dxjnr\{closure}() C:\dev\web\project\vendor\symfony\symfony\src\Symfony\Component\EventDispatcher\EventDispatcher.php:229 0.4437 16269144 16. ContainerY5dxjnr\appProdProjectContainer->load() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1410 0.4439 16271184 17. require('C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeAdderService.php') C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1254 0.4441 16274944 18. ContainerY5dxjnr\appProdProjectContainer->load() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeAdderService.php:8 0.4443 16313976 19. require('C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFactoryService.php') C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1254 0.4483 16460600 20. ContainerY5dxjnr\appProdProjectContainer->load() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFactoryService.php:16 0.4484 16471240 21. require('C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFile_FactoryService.php') C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1254 0.4486 16545184 22. ContainerY5dxjnr\appProdProjectContainer->load() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFile_FactoryService.php:8 0.4488 16547312 23. require('C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFile_Toolbox_FileService.php') C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\appProdProjectContainer.php:1254 0.4496 16659112 24. MetaModels\Helper\ToolboxFile->__construct() C:\dev\web\project\var\cache\prod\ContainerY5dxjnr\getMetamodels_AttributeFile_Toolbox_FileService.php:8 ```

Steps to reproduce

  1. Run contao-console debug:event-dispatcher

Describe the expected behaviour of the application

There shouldn't be any notices :-)

bezin commented 5 years ago

Latest commit fixes the notices regarding TL_CONFIG as expected 👍

discordier commented 5 years ago

The session problem should also be gone?

bezin commented 5 years ago

My bad, Session notice fixed as well 👍 Thanks!