PHP8 undefined array key "admin_notices" fatal error line 5748

Using PHP8 and wordpress 6.1.1 going to the Forms main menu causes a critical error. Error log provided this info:

"PHP message: PHP Warning: Undefined array key “admin_notices” in /wp-content/plugins/gravityforms/common.php on line 5748PHP message: PHP Warning: Attempt to read property “callbacks” on null in /wp-content/plugins/gravityforms/common.php on line 5748PHP message: PHP Fatal error: Uncaught TypeError: array_replace(): Argument #1 ($array) must be of type array, null given in /wp-content/plugins/gravityforms/common.php:5754

I edited the code directly to get it working again, but please update the plugin. I have to deactivate automatic updates till this is fixed.

Replace this:
$notices = $wp_filter[‘admin_notices’]->callbacks;

with this:
$notices = isset( $wp_filter[‘admin_notices’] ) ? $wp_filter[‘admin_notices’]->callbacks : array();

What version of Gravity Forms do you have installed?

I’m using the latest version. v2.7.2 I’ve always had auto updates on since I’ve never had a problem before.

Thank you. I have not seen that PHP warning with PHP 8 and the latest WordPress and Gravity Forms. I recommend first checking for conflicts with other software on the site that may integrate with Gravity Forms. You can use these steps:

If that does not find the issue, please open a support ticket and include your system status report.

System Status Report:

Open a support ticket:
https://www.gravityforms.com/open-support-ticket/technical/

Thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.