Skip to content

Clearable Select Field: Default is "Reapplied" on Update #4859

@caseydwyer

Description

@caseydwyer

Bug description

When updating an entry with a clearable Select field, the default value is "reapplied" the next time you load the edit page via CP. So if you go in and update some other part of an Entry, you'll unintentionally/unknowingly update the Select field's value to whatever the default is.

How to reproduce

  1. Create a Collection
  2. On the Blueprint, add a Select field that's both Clearable and has a Default Value
  3. Create a new Entry for the Collection
  4. Observe the default value is entered on the Create screen
  5. Clear the default value and save the Entry
  6. Check the Entry's MD as a sanity-check (ie, to verify the Select's value is empty)
  7. Reload the Entry's edit page in CP
  8. Check the Select field; the default value has been "silently reapplied"

Logs

No response

Versions

Statamic 3.2.24 Pro
Laravel 8.73.2
PHP 7.4.3
arckinteractive/statamic-bard-font-size 1.0.0
doublethreedigital/duplicator 2.0.1
jonassiewertsen/statamic-livewire 2.7.0

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

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