Skip to content

500 error and 'Reusable' tab disappears when a reusable block is embedded into itself #18704

@MetaPrinxss

Description

@MetaPrinxss

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

  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.

  2. Embed a new reusable block into the one you just created. Pick a random block.

p10

  1. Switch the view to 'Code Editor' and enter the ID from step Add/local build #2. Update the post.

p11

  1. 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)

  2. Go to Posts -> Add New. Open up the "Network" tab in Google Chrome. Clear anything there to get a fresh list.

p12

  1. Add a new block. You should get a 500 error and the "Reusable" tab is missing.

p15

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

p13

  1. 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

Metadata

Metadata

Assignees

Labels

Needs DevReady for, and needs developer efforts[Feature] Synced PatternsRelated to synced patterns (formerly reusable blocks)[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions