Skip to content

[BUG] sxc.data does not allow null number fields #3681

@enfJoao

Description

@enfJoao

Bug Affects...

[x] Content Types or data management

Current Behavior / Expected Behavior

Age is a number field. It's optional, so it can be null/empty.
If I edit the entity with 2sxc UI, I can leave the field empty and the api will accept null.
However, at web api this does not happen.
If an int field gets a null value (or empty string), it always returns a 400:
https://c.y.pt/api/2sxc/app/auto/data/eType/66 400 (Bad Request)

To Reproduce (Steps, Videos, Screenshots, Apps)

eSvc = $2sxc(moduleId).data('eType');

const updatedE = {
    // a lot of working fields here
    Age: null
};

eSvc.update(eId, updatedE);

If I set Age to any valid number, it works as intended.

Your environment

  • 2sxc version(s): 20.50
  • DNN / Oqtane: Dnn 10.01

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