Copying works fine (at least it doesn't produce an error), but pasting in this scenario causes an error as well. The exception and stack trace are identical in this case.
EDIT: After some further testing, it's unrelated to whether the entry has been saved before. The error occurs when trying to save a matrix block that was just created and hasn't been saved yet. Creating a new block normally and then trying to clone it causes the same error as seen above, even on published entries.
Steps to reproduce
Create a new entry with a matrix field and create a new block in that field.
Description
Trying to clone a matrix block immediately after creating a new entry causes a server error. Here's a screencast showing the error:
https://user-images.githubusercontent.com/10146880/171408417-a9b1968d-fc49-4500-8b0e-9dad6662ee05.mov
I checked the network tab, the request comes back as a HTTP 500 error. Here's the included strack trace:
Copying works fine (at least it doesn't produce an error), but pasting in this scenario causes an error as well. The exception and stack trace are identical in this case.
EDIT: After some further testing, it's unrelated to whether the entry has been saved before. The error occurs when trying to save a matrix block that was just created and hasn't been saved yet. Creating a new block normally and then trying to clone it causes the same error as seen above, even on published entries.
Steps to reproduce
Additional info