Skip to content

[Bug]: Booleans are stored a strings #27

@ogg1980

Description

@ogg1980

What happened?

I'm currently working on beeing able edit (continue filling out) an existing entry, and I noticed that in the entry data, bools for checkboxes etc. are stored as strings and not bools; for example:

{"type":"Toggle","field":"Toggle","answer":"false","field_id":23}

instead of (in my opinion "correct" way):

{"type":"Toggle","field":"Toggle","answer":false,"field_id":23}

This is the culprint i think:

$valueData = (bool) $value ? 'true' : 'false';

Is this a bug or a feature? Is there a logic to this I don't see?

How to reproduce the bug

Create a form with a Checkbox or Toggle and look at the saved entry in the DB.

Package Version

078e32b

PHP Version

8.4

Laravel Version

12

Which operating systems does with happen with?

No response

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions