"Convert to Blocks" fails if the block is not allowed by 'allowed_block_types_all' #66620
Open
3 of 6 tasks
Labels
[Feature] Convert to Blocks
Internally: "raw handler"
[Type] Bug
An existing feature does not function as intended
Description
Attempting to "Convert to Blocks" silently fails on installations if the chosen block for a section of HTML is not allowed by the theme/plugin.
I ran into this because of old posts that have paragraphs containing a single URL (I narrowed it down to this by deleting chunks of the content until I found this was the offending HTML). These can't be converted because the converter tries to turn them into a URL Embed block but can't because that block is filtered out out using
allowed_block_types_all
. I'd expect this to just go to the next best block (core/paragraph) if that block isn't available.From a brief look I think this is happening in htmlToBlocks where
getRawTransforms
is possibly including transforms for disallowed blocks? I'm not very familiar with this area of WordPress so that might be incorrect.Step-by-step reproduction instructions
allowed_block_types_all
.<p>https://www.example.com/</p>
.Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: