Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving override-settings to new config/system directory fails composer install with database updateschema command #54

Open
Patta opened this issue Jul 25, 2024 · 2 comments

Comments

@Patta
Copy link

Patta commented Jul 25, 2024

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$
@helhum
Copy link
Owner

helhum commented Dec 5, 2024

I have not tested yet, but I see no reason changing the path should influence behaviour. Do you happen to have time to dig further and point out which code seemingly fails?

@Patta
Copy link
Author

Patta commented Dec 6, 2024

I tested again with TYPO3 12.4.23 and PHP 8.3.14. The exception still occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants