Skip to content

Multi Select fields via the API show with null, when not filled with empty string #993

Description

@BastianHammer

Issue

When I use the JSON API (and in some constellation of the import as well - still digging there for details) to create a record with a multi select field, I need to add the field like so into my payload:

"field_name": "",

otherwise, a null is displayed in the UI on edit and a list item dot on detail view:

Image Image

It seems like a bug, that if I don't add the field into my payload, there is a null and cumbersome UI / manual correction work required. But with an empty string, all is good.

Possible Fix

If the key-value pair for a multi select field isn't in the payload, the standard behaviour should probably be to initialize it with an empty string, instead of null in the UI ( ^^ in the DB).

Steps to Reproduce the Issue

1. POST a payload without a key-value pair for a multi select field via JSON API

Context

No response

Version

8.10.1

What browser are you currently using?

Other

Browser Version

No response

Environment Information

MariaDB, PHP8.4

Operating System and Version

Ubuntu 24

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: APIIssues & PRs related to all things regarding the APIStatus:Requires UpdatesIssues & PRs which requires input or update from the authorType: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions