Skip to content

Latest Posts: Category restriction not working on existing blocks #21357

Closed

Description

Describe the bug

An existing Latest Posts block that shows posts from a category no longer filters the category, it shows all posts. Previous GB versions saved the category as a string, but the change in #20781 switched this to an array.

To reproduce

  1. Using Gutenberg 7.7.1 (or other previous version), add a Latest Posts block with a selected category
  2. Update to master, view your post — it's no longer respecting the category restriction
  3. On the frontend, you get a PHP warning: array_column() expects parameter 1 to be array, string given in /var/www/html/wp-content/plugins/gutenberg/build/block-library/blocks/latest-posts.php on line 50
  4. Switch into the editor, your category is no longer selected (and the attribute is removed, since it's invalid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

[Block] Latest PostsAffects the Latest Posts Block[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