Make WordPress Core

Opened 7 weeks ago

Last modified 5 weeks ago

#60918 new defect (bug)

parse_blocks stopped returning content and text in attrs in 6.5

Reported by: olenakuzmenko's profile olenakuzmenko Owned by:
Milestone: Awaiting Review 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 (4)

#1 @swissspidy
5 weeks ago

  • Component changed from REST API to Editor
  • Keywords reporter-feedback added
  • Severity changed from major to normal

Is this a bug in core or in the plugin?

cc @spacedmonkey

#2 @olenakuzmenko
5 weeks 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 @spacedmonkey
5 weeks 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.

#4 @olenakuzmenko
5 weeks ago

@spacedmonkey , thank you for the investigation! I tested your PR and the changes look good to me, all work as expected with them.

Note: See TracTickets for help on using tickets.