Post Tags - link color gives PHP error if post untagged #35769
Labels
[Block] Post Terms
Affects the Post Terms Block
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
When using the Post Tags block and setting a link color, the front end gives PHP errors, when a post is untagged:
Notice: Undefined offset: 0 in C:\xampp\apps\wordpress\htdocs\wp-content\plugins\gutenberg\lib\block-supports\elements.php on line 47
Notice: Trying to access array offset on value of type null in C:\xampp\apps\wordpress\htdocs\wp-content\plugins\gutenberg\lib\block-supports\elements.php on line 47
Notice: Undefined offset: 0 in C:\xampp\apps\wordpress\htdocs\wp-content\plugins\gutenberg\lib\block-supports\elements.php on line 59
Notice: Trying to access array offset on value of type null in C:\xampp\apps\wordpress\htdocs\wp-content\plugins\gutenberg\lib\block-supports\elements.php on line 59
Looks like trying to add the
wp-elements-xxxxx
class to a non-existant Post Tag block.I think the error would also surface for the Post Categories block, if it wasn't for the fact that when a post is uncategorized, the Post Categories block is rendered as 'Uncategorized'.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
WP 5.8.1
Gutenberg 11.7
Theme TT1-Blocks
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: