Hello.
Began receiving fatal errors on the site related to the component shortcode:
PHP Fatal error: Uncaught TypeError: array_merge(): Argument #2 must be of type array, null given in /wp-content/themes/pro/cornerstone/includes/classes/Services/Components.php:146
Seems like line 134 was not accuratly setting $parameters to an empty array.
$parameters = is_string($atts['parameters'])
? json_decode($atts['parameters'], true)
: [];
I added this after 134 and before 146
if (!is_array($parameters)) {
$parameters = [];
}
The error went away and the page and editor loaded again successfully.
I don’t like editing Parent theme files and I don’t consider this a ‘fix’, more of a ‘patch-to-get-us-working’.
Based on this error and fix, can you help me by pointing to potential issues that might have triggered that? Are we breaking some parameter code or misconfiguring a component?
PHP 8.0
WP 6.2.2
Pro 6.2.7
Thank you