Skip to content

Integer field type does not allow null values for config #8932

@maurice-ellis

Description

@maurice-ellis

Bug description

#1203 allows for null except for config. I'm not sure the reason for this, but I'm in a situation where I need to set the max value to null, so that there will not be a maximum.

How to reproduce

Set integer default to null in config fields and it will be set as 0. The code prevents null values from being set.

public function preProcessConfig($data)
{
    return (int) $data;
}

Logs

No response

Environment

Application Name: Laravel
Laravel Version: 10.30.1
PHP Version: 8.2.3
Composer Version: 2.4.4
Environment: local
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 2
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.31.0 PRO

Statamic Addons
thrtwoe/builder: dev-main
thrtwoe/jumpstart: dev-main

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

None

Additional details

Believe there is a need for nulls for integers specifically when it's used to prevent max or min from being set.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions