Skip to content

Creation order parent-children inversed #10864

@GregoireHebert

Description

@GregoireHebert

BC Break Report

Q A
BC Break yes
Version 2.16.0

Summary

Record order creation has changed.
Probably following this : #10547

Previous behavior

Creation of an entity an its child.

{
      "_links": {
        "self": {
          "href": "/max_depth_eager_dummies/1"
        },
        "child": {
          "href": "/max_depth_eager_dummies/2"
        }
      },
      "_embedded": {
        "child": {
          "_links": {
            "self": {
              "href": "/max_depth_eager_dummies/2"
            }
          },
          "id": 2,
          "name": "level 2"
        }
      },
      "id": 1,
      "name": "level 1"
    }

Current behavior

Now the child is created before the parent.

        {
          "_links": {
              "self": {
                  "href": "/max_depth_eager_dummies/2"
              },
              "child": {
                  "href": "/max_depth_eager_dummies/1"
              }
          },
          "_embedded": {
              "child": {
                  "_links": {
                      "self": {
                          "href": "/max_depth_eager_dummies/1"
                      }
                  },
                  "id": 1,
                  "name": "level 2"
              }
          },
          "id": 2,
          "name": "level 1"
      }

How to reproduce

Get the last version of API Platform and run this scenario:
https://github.com/api-platform/core/actions/runs/5727605051/job/15520391811?pr=5675#step:9:94

Downgrading to 2.15.5 fixes the problem.

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