Skip to content

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

Closed

Description

@ryelle

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)

Activity

  1. added
    [Type] Bug
    [Block] Latest Posts
    on Apr 2, 2020
  2. added
    [Status] In Progress
    on Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Block] Latest Posts[Status] In Progress[Type] Bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions