Opened 7 months ago
Closed 4 months ago
#60918 closed defect (bug) (invalid)
parse_blocks stopped returning content and text in attrs in 6.5
Reported by: | olenakuzmenko | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.5 |
Component: | Editor | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
parse_blocks stopped returning content and text in attrs in 6.5
We are using wp-rest-blocks to process WordPress article in our system. With version 6.5, there is a new issue discovered https://github.com/spacedmonkey/wp-rest-blocks/issues/69(https://github.com/spacedmonkey/wp-rest-blocks/issues/69)
Taking a look at it, parse_blocks method stopped returning text and content for paragraphs/buttons/list items/probably other components as well.
Example of what we receive for the paragraph now:
[10] => Array ( [blockName] => core/paragraph [attrs] => Array ( ) [innerBlocks] => Array ( ) [innerHTML] => <p>some <strong>another</strong> <em>paragraph</em> block with <a href="https://jsonformatter.curiousconcept.com/">formatting</a>, a lot of <mark style="background-color:#af1685;color:#e37bc7" class="has-inline-color">formatting</mark>! </p> [innerContent] => Array ( [0] => <p>some <strong>another</strong> <em>paragraph</em> block with <a href="https://jsonformatter.curiousconcept.com/">formatting</a>, a lot of <mark style="background-color:#af1685;color:#e37bc7" class="has-inline-color">formatting</mark>! </p> ) )
What we expect to receive:
[10] => Array ( [blockName] => core/paragraph [attrs] => Array ( [content] => some <strong>another</strong> <em>paragraph</em> block with <a href=\"https://jsonformatter.curiousconcept.com/\">formatting</a>, a lot of <mark style=\"background-color:#af1685;color:#e37bc7\" class=\"has-inline-color\">formatting</mark>! ) [innerBlocks] => Array ( ) [innerHTML] => <p>some <strong>another</strong> <em>paragraph</em> block with <a href="https://jsonformatter.curiousconcept.com/">formatting</a>, a lot of <mark style="background-color:#af1685;color:#e37bc7" class="has-inline-color">formatting</mark>! </p> [innerContent] => Array ( [0] => <p>some <strong>another</strong> <em>paragraph</em> block with <a href="https://jsonformatter.curiousconcept.com/">formatting</a>, a lot of <mark style="background-color:#af1685;color:#e37bc7" class="has-inline-color">formatting</mark>! </p> ) )
I am putting a major severity on it, as it blocks completely our system.
Change History (5)
#1
@
7 months ago
- Component changed from REST API to Editor
- Keywords reporter-feedback added
- Severity changed from major to normal
#2
@
7 months ago
Hi @swissspidy , it's a bug in the core. The plugin simply takes whatever is returned back by parse_blocks method and returns it back in JSON. Since there is nothing returned in "content" and "text" fields, the plugin doesn't return anything back, which is the correct behaviour for it.
#3
@
7 months ago
Hey @olenakuzmenko. It is a mixture of a change in core and the plugin not being updated. In WP 6.5, there is a new attribute type of rich-text. The attributes highlight use this new attribute type. So the change was undocumented in the release notes, so I didn't update my plugin. I have a PR now, so if you want help test, I will cut a new release.
Is this a bug in core or in the plugin?
cc @spacedmonkey