This implements the missing block when a previously registered block is not available.
The way this works is that when a block is missing, we replace it with the missing blockType and store the original block type json from the database in the missing blockType's originalContent attribute.
Then, when the block is found again as a registered block, we replace the missing block with the stored originalContent attribute.
Note: this is currently pulling in the WordPress core missing blockType to achieve this. After going through this, I think it might be better to supply our own version to prevent any conflicts in future WP versions.
Affects
The form builder and how it handles missing blocks
Visuals
Testing Instructions
Install a block extension like fee recovery
Create a v3 form, add the fee recovery block and save.
Deactivate the fee recovery plugin and go back to the form
You should now see a notice about the missing block
Now try re-activating the plugin to see the original block
Now go de-activate the plugin again and return to the form
This time, make a change to the form and save
Refresh the form builder and make sure that missing block notice is still there
Once again, re-activate the plugin to make sure you see the original block in the form builder
You should also see the field on the form front-end without needing to save changes.
Pre-review Checklist
[ ] Acceptance criteria satisfied and marked in related issue
[x] Relevant @unreleased tags included in DocBlocks
[ ] Includes unit tests
[ ] Reviewed by the designer (if follows a design)
Description
This implements the missing block when a previously registered block is not available.
The way this works is that when a block is missing, we replace it with the missing blockType and store the original block type json from the database in the missing blockType's originalContent attribute.
Then, when the block is found again as a registered block, we replace the missing block with the stored originalContent attribute.
Note: this is currently pulling in the WordPress core missing blockType to achieve this. After going through this, I think it might be better to supply our own version to prevent any conflicts in future WP versions.
Affects
Visuals
Testing Instructions
Pre-review Checklist
@unreleased
tags included in DocBlocks