block-lab icon indicating copy to clipboard operation
block-lab copied to clipboard

Renaming a block's slug causes it to break in documents where it is already in use

Open x5hwuk7nc6jsudcc opened this issue 5 years ago • 2 comments

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.

x5hwuk7nc6jsudcc avatar May 28 '19 01:05 x5hwuk7nc6jsudcc

Thanks for reporting this!

lukecarbis avatar May 28 '19 23:05 lukecarbis

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.

kienstra avatar Nov 27 '19 18:11 kienstra