Skip to content

ComponentReflection::convertType() empty string problem #318

Open
@romanbartl

Description

@romanbartl

Hey there,

When you declare persistent variable of int|null type inside of Control, and in URL coresponding parameter is empty string, than type error occurs. From what I've learnt this error happens in ComponentReflection in castScalar() method when you try to check whether data-loss happens. It seems that this peace of code does not count with nullable persistent parameters. It happens because strict typed comparassion.

I would expect that when there is given an empty string in GET/POST, and declared coresponding persistent variable is nullable, than 'null' should be assigned. If it makes sence.

Tested on version: 3.1.17.

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