typo3-config-handling
typo3-config-handling copied to clipboard
Moving override-settings to new config/system directory fails composer install with database updateschema command
To be in line with the new default directory for the system configuration of typo3 v12, we want to move our config files to the new config/system
directory.
The directory layout configuration from https://github.com/helhum/typo3-config-handling/tree/main?tab=readme-ov-file#default-layout is changed to the following and the yaml files are moved to config/system
.
{
"extra": {
"helhum/typo3-config-handling": {
"settings": "config/system/settings.yaml",
"dev-settings": "config/system/dev.settings.yaml",
"override-settings": "config/system/override.settings.yaml"
}
}
}
In our override.settings.yaml
we set the database connection for ddev. (In production/remote server for the remote database server...)
DB:
Connections:
Default:
charset: utf8mb4
dbname: db
driver: mysqli
host: db
password: db
port: 3306
tableoptions:
charset: utf8mb4
collate: utf8mb4_unicode_ci
user: db
We update the database schema after every composer update or install in post-install-cmd
and post-update-cmd
in our root composer.json
with the typo3-console command typo3 database:updateschema
.
...
"scripts": {
"post-install-cmd": [
"typo3 database:updateschema",
"typo3 extension:setup",
"@clearassets",
"typo3 cache:flush",
"@warmupcache"
],
"post-update-cmd": [
"typo3 database:updateschema",
"typo3 extension:setup",
"@clearassets",
"typo3 cache:flush"
],
},
...
Unfortunately, the composer install/update now fails when typo3 database:updateschema
is executed after composer install/update. Without this command or if the override.settings.yaml
is placed not in the config/system
directory but just in config
, the composer install/update works.
...:/var/www/html$ composer u
Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating optimized autoload files
Generating class alias map file
helhum/dotenv-connector: Generated dotenv include file
Publishing public assets of TYPO3 extensions
Published public assets
79 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> typo3 database:updateschema
Uncaught TYPO3 Exception array_keys(): Argument #1 ($array) must be of type array, null given
thrown in file /var/www/html/vendor/typo3/cms-core/Classes/Database/ConnectionPool.php
in line 290
Script typo3 database:updateschema handling the post-update-cmd event returned with error code 1
...:/var/www/html$