[Style Engine] PHP Notice: Undefined index: 'individual' #43121
Labels
[Package] Style Engine
/packages/style-engine
[Type] Bug
An existing feature does not function as intended
Description
A PHP notice "Undefined index: individual" is being thrown in
WP_Style_Engine::get_css_declarations()
https://github.com/WordPress/gutenberg/blob/trunk/packages/style-engine/class-wp-style-engine.php#L418.What is happening?
WP_Style_Engine::parse_block_styles()
invokesWP_Style_Engine::get_css_declarations()
passing the style definition of the group style fromstatic::BLOCK_STYLE_DEFINITIONS_METADATA
. But not all'property_keys'
contain an'individual'
parameter, such as'color'
.Notice how
WP_Style_Engine::get_individual_property_css_declarations()
provides guarding to ensure the key exists in the style definition before accessing itgutenberg/packages/style-engine/class-wp-style-engine.php
Lines 464 to 466 in 22801cf
Questions:
WP_Style_Engine::parse_block_styles()
be passing all of thestatic::BLOCK_STYLE_DEFINITIONS_METADATA
toWP_Style_Engine::get_css_declarations()
for processing?WP_Style_Engine::get_css_declarations()
when a style definition'sproperty_keys'
do not define the'individual'
parameter? Should it skip that$style_value
? (I assume yes.)Step-by-step reproduction instructions
define( 'WP_DEBUG', true );
in your local environment'swp-config.php
file OR in the PHPUnit'sbootstrap.php
file.Screenshots, screen recording, code snippet
First found when turning on
WP_DEBUG
for its PHPUnit tests https://github.com/WordPress/gutenberg/runs/7756878353?check_suite_focus=trueEnvironment info
trunk
trunk
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: