PHP fatal error in Cornerstone preview — _builder_atts null check missing in Cornerstone Forms plugin

Any page containing a Cornerstone Form fails to load in the Cornerstone editor preview, returning a 500 error. The front-end renders correctly — this only affects the Cornerstone preview.

Environment:

  • Pro Theme (latest version)
  • Cornerstone 7.8+
  • Cornerstone Forms (latest)
  • WordPress (latest)
  • SiteGround hosting

Error from debug.log:

PHP Warning: Undefined array key "_builder_atts" in
wp-content/plugins/cornerstone-forms/extension/Actions/Action.php on line 84

PHP Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in
wp-content/plugins/cornerstone-forms/extension/Actions/Action.php:84

The same error also occurs in ActionGroup.php on line 54.

Root cause:

Both Action.php (line 84) and ActionGroup.php (line 54) access $data['_builder_atts'] without checking if the key exists. When _builder_atts is not present in the data array, array_merge() receives null and throws a fatal error. This code only runs inside is_cornerstone_preview() , which is why the front-end is unaffected.

Temporary fix:

Changing $data['_builder_atts'] to $data['_builder_atts'] ?? [] on both lines resolves the issue. This falls back to an empty array instead of passing null to array_merge() .

Could this null check be added in the next plugin update so the fix persists?

Hey Joshua,

Thanks for writing in! I could not replicate the issue in our test server. I am having 4 actions for the Cornerstone Forms. I do not have any 404 errors or a PHP Warning. We would be happy to double check your site if we can log in. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.