Skip to content

Gutenberg Category and Tag Link blocks don't work on front end - invalid use of ID attribute #52

@bobbingwide

Description

@bobbingwide

https://blocks.wp.a2z/block/navigation-link-core-navigation-link/category-link-core-navigation-link/

Warning: Attempt to read property "post_status" on null in C:\apache\htdocs\wordpress\wp-content\plugins\gutenberg\build\block-library\blocks\navigation-link.php on line 110

Warning: Attempt to read property "post_status" on null in C:\apache\htdocs\wordpress\wp-content\plugins\gutenberg\build\block-library\blocks\navigation-link.php on line 110

Editing the post produced the same warnings, then on interacting with the Core Navigation block ( horizontal ) I got "This block has encountered an error and cannot be previewed". 12 Errors in the console log.

There were 5 empty social links in the menu. I removed these and the warnings still appeared. No menu items were visible.
Both of the links appeared to be valid.
image

Neither link had a Description, Link title or Link rel

The problem was that the $attributes['id'] values ( 469 for Block News and 39 for News ) don't refer to posts
These are the values of the term_id for the categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GutenbergA bug / enhancement to GutenbergbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions