codefog / contao-haste

Haste is a collection of tools and classes to ease working with Contao
http://codefog.pl/extension/haste.html
MIT License
43 stars 24 forks source link

Fatal error: Class 'Haste\Dca\DateRangeFilter' not found #82

Closed Samson1964 closed 8 years ago

Samson1964 commented 8 years ago

Ich habe das Haste-Release von heute unter system/modules/haste installiert. Nach dem Aufruf der Datenbankaktualisierung im BE verabschiedet sich Contao 3.5.9 (als auch 3.5.6):

Warning: in_array() expects parameter 2 to be array, null given in system/modules/core/library/Contao/System.php on line 140

#0 unknown file(unknown line): __error_enhanced(2, 'in_array() expects parameter 2 to be array, null given', 'system/modules/core/library/Contao/System.php', 140, Array)
#1 system/modules/core/library/Contao/System.php(140): in_array('getInstance', NULL)
#2 system/modules/core/library/Contao/DcaLoader.php(96): Contao\System->import('Haste\Dca\DateRangeFilter')
#3 system/modules/core/library/Contao/Controller.php(1300): Contao\DcaLoader->load(false)
#4 system/modules/core/dca/tl_article.php(15): Contao\Controller::loadDataContainer('tl_page')
#5 system/modules/core/library/Contao/DcaLoader.php(86): include('system/modules/core/dca/tl_article.php')
#6 system/modules/core/library/Contao/Controller.php(1300): Contao\DcaLoader->load(false)
#7 system/modules/core/library/Contao/DcaExtractor.php(382): Contao\Controller::loadDataContainer('tl_article')
#8 system/modules/core/library/Contao/DcaExtractor.php(128): Contao\DcaExtractor->createExtract()
#9 system/modules/core/library/Contao/DcaExtractor.php(144): Contao\DcaExtractor->__construct('tl_article')
#10 system/modules/core/library/Contao/Database/Installer.php(295): Contao\DcaExtractor::getInstance('tl_article')
#11 system/modules/core/library/Contao/Database/Installer.php(111): Contao\Database\Installer->getFromDca()
#12 system/modules/core/library/Contao/Database/Installer.php(41): Contao\Database\Installer->compileCommands()
#13 system/modules/repository/classes/RepositoryManager.php(486): Contao\Database\Installer->generateSqlForm()
#14 system/modules/repository/classes/RepositoryBackendModule.php(153): RepositoryManager->update('database')
#15 system/modules/core/classes/BackendModule.php(98): RepositoryBackendModule->compile()
#16 system/modules/repository/classes/RepositoryBackendModule.php(72): Contao\BackendModule->generate()
#17 system/modules/repository/classes/RepositoryManager.php(57): RepositoryBackendModule->generate()
#18 system/modules/core/classes/Backend.php(423): RepositoryManager->generate()
#19 system/modules/core/controllers/BackendMain.php(131): Contao\Backend->getBackendModule('repository_manager')
#20 contao/main.php(20): Contao\BackendMain->run()

Fatal error: Class 'Haste\Dca\DateRangeFilter' not found in system/modules/core/library/Contao/System.php on line 140
Samson1964 commented 8 years ago

Hat sich wahrscheinlich erledigt. Haste verwendet wohl nicht den Contao-Namespace-Loader sondern einen eigenen, wie ich in der README.md gelesen habe.

marcosimbuerger commented 8 years ago

For Contao 4:

1) Add haste class to autoload in composer.json:

"autoload": {
    "psr-0": {
        "Haste\\": [
            "system/modules/contao-haste/library"
        ]
    },
    "classmap": [
        "app/AppCache.php",
        "app/AppKernel.php"
    ]
},

2) Run "composer dump-autoload"

3) Clear cache "app/console cache:clear -e prod"

aschempp commented 8 years ago

Why would you add Haste classes to the composer.json for autoloading? It should already be autoloaded by Composer (see https://github.com/codefog/contao-haste/blob/master/composer.json#L32-L38)