Skip to content

Cannot update NULL value in custom module #26582

Open
@textarea

Description

@textarea

Preconditions (*)

  1. Magento 2.3.4 & 2.4-develop
  2. PHP 7.2.27

Steps to reproduce (*)

  1. Create a custom module with a field of any data type, for example "varchar", nullable.
  2. Insert one record with a (not null) value into the varchar field
  3. Update programmatically with null value, i.e.:
$testRepository = $obj->get('\Acme\Test\Api\TestRepositoryInterface');
$test = $testRepository->get(1);
$test->setField(NULL);
$testRepository->save($test);

Expected result (*)

  1. Field value is NULL

Actual result (*)

  1. Field value still contains the old value

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: DBEvent: mm20inIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.Progress: ready for devReported on 2.3.4Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itstale issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions