Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ryelle opened this issue Apr 2, 2020 · 0 comments · Fixed by #21359
Closed

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

ryelle opened this issue Apr 2, 2020 · 0 comments · Fixed by #21359
Assignees
Labels
[Block] Latest Posts Affects the Latest Posts Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@ryelle
Copy link
Contributor

ryelle commented Apr 2, 2020

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)
@ryelle ryelle added [Type] Bug An existing feature does not function as intended [Block] Latest Posts Affects the Latest Posts Block labels Apr 2, 2020
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Latest Posts Affects the Latest Posts Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant