Skip to content

Record casting is very inconsistent #308

@guppy42

Description

@guppy42

I'm getting this error in the backend when I put content inside a container:

B13\Container\Domain\Model\Container::hasChildInColPos(): Argument #1 ($colPos) must be of type int, string given, called in /docroot/container/Classes/Hooks/UsedRecords.php on line 52

And this one when trying to show the list of upgrade wizzards:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: B13\Container\Domain\Factory\ContainerFactory::buildContainer(): Argument #1 ($uid) must be of type int, string given, called in /docroot/container/Classes/Integrity/Sorting.php on line 104 | TypeError thrown in file /var/www/shared/Typo3_11_Moduler/container/Classes/Domain/Factory/ContainerFactory.php in line 55. Requested URL: https://site/typo3/install.php?install[controller]=upgrade&install[context]=backend&install[action]=upgradeWizardsList

Seems the extension expects the record data to be int and not string?

yet the fields are cast to int in lots of other places - heck UsedRecord cast it to int for the check (Line 48), and then doesn't for the actual function calls (Line 50,52).

Test env:

Php: 7.4, 8.1
T3: 11.5.16
SQL: MySQL 5.6.17 ( driver: pdo_mysql, charset: utf8mb4 )
Other extensions: bootstrap_package

I could go through the entire thing and add (int) in every place it's needed so it's consistent, but since it's working for other people I do wonder what is different that the records aren't string values. ( the fields are all int(10) in the DB )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions