Open
Description
Describe the Bug
Somewhat related to #8784 / #8790, which was already fixed for nested arrays/nested regular blocks (CC: @r1tsuu)
However, when a Lexical block is nested into a regular block, and the outer regular block is duplicated, the inner Lexical block will still get the same ID as the original Lexical block.
Link to the code that reproduces this issue
bratvanov/payload-lexical-block-duplicate-id@d5f833a
Reproduction Steps
- Have a blocks field containing a richText field containing a custom Lexical block.
- Duplicate the outer block via the admin UI context (...) menu.
- The new block's nested Lexical block has the same ID as the original.
{
"blockType": "sections",
"content": {
"root": {
"children": [
{
"type": "block",
"fields": {
"id": "67c0658ae002eb8c202022bf",
"blockType": "simpleBlock"
}
}
],
}
},
"id": "67c0658618c45a82f4b65509"
},
{
"blockType": "sections",
"content": {
"root": {
"children": [
{
"type": "block",
"fields": {
"id": "67c0658ae002eb8c202022bf",
"blockType": "simpleBlock"
}
}
],
}
},
"id": "67c0658c18c45a82f4b6550e"
}
Which area(s) are affected? (Select all that apply)
plugin: richtext-lexical, area: core
Environment Info
Node: 22.12.0
payload: 3.24.0
next: 15.1.5
@payloadcms/db-mongodb: 3.24.0