Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicating blocks with blocks errors #8784

Closed
DanRibbens opened this issue Oct 18, 2024 · 2 comments · Fixed by #8790
Closed

Duplicating blocks with blocks errors #8784

DanRibbens opened this issue Oct 18, 2024 · 2 comments · Fixed by #8790

Comments

@DanRibbens
Copy link
Contributor

Describe the Bug

You can have duplicate IDs for subblocks after duplicating a parent block, resulting in a duplicate ID error from postgres.

Link to the code that reproduces this issue

pnpm dev fields

Reproduction Steps

From the monorepo on beta,

  1. pnpm dev fields
  2. navigate to blocks /admin/collection/block-fields
  3. duplicate the top "Sub-Block demostration" block
  4. Save
  5. Error: The following field is invalid: id

In the form state in duplicate will have multiple of the same ID for subBlocks.0.id within the rows, for example:

        "subBlocks.0.id": {
            "errorPaths": [],
            "initialValue": "67127e767e97675fcceae274",
            "passesCondition": true,
            "valid": true,
            "value": "67127e767e97675fcceae274"
        },

Which area(s) are affected? (Select all that apply)

area: ui

Environment Info

payload 3.0.0-beta.114
db-postgres

@DanRibbens DanRibbens added status: needs-triage Possible bug which hasn't been reproduced yet v3 prioritized labels Oct 18, 2024
DanRibbens pushed a commit that referenced this issue Oct 21, 2024
…s with postgres (#8790)

Fixes #8784

This works for any deep level, both arrays and blocks.
@r1tsuu r1tsuu closed this as completed Oct 21, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Oct 21, 2024
r1tsuu added a commit that referenced this issue Oct 21, 2024
…s with postgres (#8790)

Fixes #8784

This works for any deep level, both arrays and blocks.
Copy link

🚀 This is included in version v3.0.0-beta.117

Copy link

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants