Skip to content

Auto-save performed when manipulating a footnotes block breaks attributes in other blocks. #53212

@celtislab

Description

@celtislab

Description

In function updateAttributes(attributes) in const updateFootnotes called in the footnote block,

Recursive calls to the updateAttributes function

        if (Array.isArray(value)) {
          attributes[key] = value.map(updateAttributes);
          continue;
        }

If there is an attribute of an array of strings at this time

                imgSizes : {
                    type: "array",
                    items: {
                        type: "string"
                    },
                    default: []
                },

For example, the string "1024x768" is converted to {0: "1", 1: "0", 2: "2", 3: "4", 4: "x", 5: "7", 6: "6", 7: "8"} and an error occurs

Step-by-step reproduction instructions

This happens when you manipulate the footnote block in the editor.

This happens in blocks that use an array of strings in the attributes, but does not seem to be used in the core block.

Screenshots, screen recording, code snippet

gutenberg-footnotes-attribute

Environment info

WordPress 6.3 RC2

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

No

Metadata

Metadata

Assignees

Labels

[Block] FootnotesAffects the Footnotes Block[Type] BugAn existing feature does not function as intended

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions