-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Describe the bug
When a reusable block has a reusable block embedded (containing the same ID) it throws a 500 error and the 'Reusable' tab disappears in WP 5.3.
To reproduce
1 Go to wp-admin/edit.php?post_type=wp_block&paged=1
-
Create a new reusable block. For this test, I am calling it 'Reusable Block Test'. You can call it anything you'd like. Publish and save, note the post ID from the URL.
-
Embed a new reusable block into the one you just created. Pick a random block.
- Switch the view to 'Code Editor' and enter the ID from step Add/local build #2. Update the post.
-
You should get an error : 'Updating failed. or Updating failed. Error message: The response is not a valid JSON response. (note that it did update)
-
Go to Posts -> Add New. Open up the "Network" tab in Google Chrome. Clear anything there to get a fresh list.
- Add a new block. You should get a 500 error and the "Reusable" tab is missing.
Request URL: */wp-json/wp/v2/blocks?per_page=100&_locale=user
Request Method: GET
Status Code: 500
Remote Address: 127.0.0.1:8080
Referrer Policy: strict-origin-when-cross-origin
- Editing the reusable block from step 2 results in a frontend error:
"There has been a critical error on your website. Please check your site admin email inbox for instructions"
Expected behavior
Adding a block allows you to add previously created Reusable Blocks by using the "Reusable" tab
Desktop (please complete the following information):
- OS: [e.g. iOS] Windows 10
- Browser [e.g. chrome, safari]: Chrome
- Version [e.g. 22] 78.0.3904.108
Additional context
WP Version: 5.3