craftcms / craftcms/cms

[4.5.3]: Default radio button option not applied when field is added to an existing entry

Open
#13,689 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug craft4
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

What happened?
Description

When adding a radio buttons field with a default option, this option is not applied to existing entries.

Steps to reproduce
  1. Create a custom field with type radio buttons, at least 2 options, one of wich is set as default.
  2. Add this field to a section's field layout.
  3. Edit an existing entry in this section.
Expected behavior

The default option should be selected

Actual behavior

No option is selected

Craft CMS version

4.5.3

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is named. Reproduce the issue by adding a radio-buttons field with a default option to an existing section, then edit an existing entry; done means the configured default option is selected instead of leaving the field empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.