Issue Bug Closed

#105356Type error in Doctrine Schema\Column::setLength argument 1 must be int

Franz Holzinger 10/18/24, 16:08 updated 12/02/25, 14:32

Description

After the activation of an extension I get this error messsage in the backend:

Doctrine\DBAL\Schema\Column::setLength(): Argument #1 ($length) must be of type ?int, string given, called in /path/typo3_src-13.4.0/vendor/doctrine/dbal/src/Schema/Column.php on line 68

Called from TCA:

at Doctrine\DBAL\Schema\Column->setLength('10')
in /path/typo3_src-13.4.0/vendor/doctrine/dbal/src/Schema/Column.php line 68
            if (! method_exists($this, $method)) {
                throw UnknownColumnOption::new($name);
            }

            $this->$method($value);
        }

        return $this;
    }
at Doctrine\DBAL\Schema\Column->setOptions(array('length' => '10', 'default' => '', 'notnull' => true))
in /path/typo3_src-13.4.0/vendor/doctrine/dbal/src/Schema/Column.php line 55
    public function __construct(string $name, Type $type, array $options = [])
    {
        $this->_setName($name);
        $this->setType($type);
        $this->setOptions($options);
    }

    /** @param array<string, mixed> $options */
    public function setOptions(array $options): self
at Doctrine\DBAL\Schema\Column->__construct('`creditpoints_gifts`', object(Doctrine\DBAL\Types\StringType), array('length' => '10', 'default' => '', 'notnull' => true))
in /path/typo3_src-13.4.0/vendor/doctrine/dbal/src/Schema/Table.php line 266

    /** @param array<string, mixed> $options */
    public function addColumn(string $name, string $typeName, array $options = []): Column
    {
        $column = new Column($name, Type::getType($typeName), $options);

        $this->_addColumn($column);

        return $column;
at Doctrine\DBAL\Schema\Table->addColumn('`creditpoints_gifts`', 'string', array('length' => '10', 'default' => '', 'notnull' => true))
in /path/typo3_src-13.4.0/typo3/sysext/core/Classes/Database/Schema/DefaultTcaSchema.php line 785
            ]
        );
        break;
    }
    $tables[$tableName]->addColumn(
        $this->quote($fieldName),
        Types::STRING,
        [
            'length' => $length,

Reviews 2