Open gerathjen opened 3 years ago
@gerathjen Is this your whole composer.json file? This is mine:
{
"name": "typo3/cms-base-distribution",
"description" : "TYPO3 CMS Base Distribution",
"license": "GPL-2.0-or-later",
"config": {
"platform": {
"php": "7.4.1"
},
"sort-packages": true
},
"require": {
"helhum/typo3-console": "^6.4.0",
[LIST OF TYPO3 PACKAGES]
},
"autoload": {
"psr-4": {
"PromotionTourWebsite\\PromotionEvents\\": "public/typo3conf/ext/promotionevents/Classes"
}
},
"scripts":{
"typo3-cms-scripts": [
"typo3cms install:generatepackagestates",
"typo3cms install:fixfolderstructure"
],
"post-autoload-dump": [
"@typo3-cms-scripts"
]
}
}
The autoload section should be nested inside an additional { }
@PhilippKuhlmay Thank you for the quickly answer. My mistake was to use the autoload line in the file packages/promotionevents/composer.json. When I use them in the file composer.json from the Docroot directory, the Typo3 exception is no longer output.
However, I would prefer to have the statement to load the classes for PromotionEvents in the composer.json file in the extension directory.
After working through the 4th step in the 9th chapter on page 244, Typo3 throws the following exception when the subpage Next readings is called:
The file EventsController.php is in the folder public/typo3conf/ext/promotionevents/Classes/Controller. I used the source code available in Github under https://github.com/Apress/the-typo3-guidebook/tree/main/Ch09/Step_4/promotionevents.
Note: I haven't only cleared the Typo3 and Composer cache, but also run the command ddev composer dumpautoload. The file composer.json contains the following lines: