Skip to content

Users field default current cannot be used through UI #8796

@jasonvarga

Description

@jasonvarga

Bug description

It's possible to set the default value of a users fieldtype to current to be able to set the currently logged-in user as the default value.

However, current isn't an option in the dropdown when you use the UI. You have to do it through the yaml file.

Also, if you do it through the yaml file, and then open up the UI, the current user is selected (good) but then when you save the field, it hard codes the current user's ID as the new default value.

How to reproduce

First

  1. Create/edit blueplueprint
  2. Add/edit users field
  3. See current is missing from the "Default" field options.
  4. In the yaml, set default: current
  5. Edit the users field in the UI again.
  6. The current user is selected.
  7. Save
  8. See that the current user is hardcoded into the blueprint

Logs

No response

Environment

Statamic 4.24.0

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

None

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