-
Notifications
You must be signed in to change notification settings - Fork 12
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
Unique field id (uuid) and block duplicates #104
Comments
Other values which should be unique are affected by this issue as well: name, data_store_key, etc... Also the steps above can be reduced to:
|
Plan: when a field block is added to the editor, it's data must be pushed into the the window.llms.userInfoFields array so that validation can take place immediately against it's data im not sure how to delete the item from the array when a block is removed that was created before being saved when duplicating / copying a field we should determine if it was a copy by checking against window.llms.userInfoFields to see if the name already exists, if it does we'll clear the id, name, uuid and data_store_key before passing to setupAtts() so that new values can be created immediately |
@thomasplevy I wonder if there's an easy way to just disable the duplicate button for our blocks... until we find a more stable solution. |
I can't find a way to disable the duplication functionality and then there's also the "copy" functionality too (also can't figure out how to disable). I also can't figure out how to solve this according to my plan. Good stuff. |
It's feeling pretty close to impossible to "solve" this and part of the reason seems to be that we're leveraging block attributes in a way that they aren't intended to be used... surprised? I'm kind of not... Saving this here for reference: WordPress/gutenberg#23377 I have written code to determine whether or not a block is a "duplicate" and, if it is, it unsets the properties that should be unique so they'll be regenerated, however it's happening in the wrong order and the source block (the block which was used to duplicate from) shows up as a duplicate first and the later block (the duplicate) ends up with the original block's properties. I need to revisit this approach to see if I can make it happen to the actual duplicate block. |
Reproduction Steps
similarly
Expected Behavior
Actual Behavior
Error Messages / Logs
n/a
System and Environment Information
head at dafd798
This issue has be recreated:
Browser, Device, and Operating System Information
n/a
The text was updated successfully, but these errors were encountered: