block-lab
block-lab copied to clipboard
Renaming a block's slug causes it to break in documents where it is already in use
How to replicate:
- Create a block and use it in a document
- Edit the block's slug and update the php filename accordingly
- Return to the document and the block looks for the previous slug with no way of updating it to the new slug
Expected functionality:
- Updating the block's slug will update it in documents where it is used automatically
- Alternatively, if a block source cannot be located (because it has been renamed) you should at least be able to specify the new location instead of just losing the block settings and content
Why this is a problem:
- It's good housekeeping to keep your filename syntax relevant and updated. This blocks that.
Thanks for reporting this!
This would be a good one to fix. Ideally, there'd be a way to store a previous slug, and map it to a current slug.
Changing the slug in all of the saved block's attributes probably won't work. We'd have to iterate over all of the posts, parse the blocks, and change the block name.