Closed tkapler closed 1 year ago
Interestingly - when i turn off the gutenberg plugin, the warning in site editor disapears, but instead theese errors appear on frontend
Warning: Trying to access array offset on value of type null in /var/www/vhosts/powerbox.one/httpdocs/wp-includes/block-supports/duotone.php on line 416
Warning: Trying to access array offset on value of type null in /var/www/vhosts/powerbox.one/httpdocs/wp-includes/block-supports/duotone.php on line 417
Warning: Trying to access array offset on value of type null in /var/www/vhosts/powerbox.one/httpdocs/wp-includes/block-supports/duotone.php on line 418
Warning: Trying to access array offset on value of type null in /var/www/vhosts/powerbox.one/httpdocs/wp-includes/block-supports/duotone.php on line 419
I was able to replicate this issue. It looks like currently the theme.json
duotone settings are only able to support hex and RGB colors..
With debug=false I was able to add CSS vars, and the options displayed in the block toolbar, but once selected they did not work:
https://user-images.githubusercontent.com/3629020/235404865-d7fda690-f120-44e2-980e-a576db7bd9c3.mp4
We probably should look to add a guard here to prevent these warnings if the theme.json has invalid color settings.
Description
I do have custom duotones in theme.json, they work fine
this is the definition btw
But when i do use gutenberg plugin and having debug=true theese errors popup when I open Site Editor:
Warning: Trying to access array offset on value of type null in /var/www/vhosts/powerbox.one/httpdocs/wp-content/plugins/gutenberg/lib/block-supports/duotone.php on line 344
Warning: Trying to access array offset on value of type null in /var/www/vhosts/powerbox.one/httpdocs/wp-content/plugins/gutenberg/lib/block-supports/duotone.php on line 345
| Warning: Trying to access array offset on value of type null in /var/www/vhosts/powerbox.one/httpdocs/wp-content/plugins/gutenberg/lib/block-supports/duotone.php on line 346
| Warning: Trying to access array offset on value of type null in /var/www/vhosts/powerbox.one/httpdocs/wp-content/plugins/gutenberg/lib/block-supports/duotone.php on line 347
Step-by-step reproduction instructions
debug = true set up duotones in theme.json enable gutenberg plugin go to site editor
Screenshots, screen recording, code snippet
No response
Environment info
latest versions of guenberg and wordpress
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