Trying to access array offset on value of type null in encrypt_config_form()

Created on 24 July 2020, almost 4 years ago
Updated 21 July 2023, 11 months ago

On the "Add configuration" form, there is not a third parameter passed to encrypt_config_form(), i.e. $config parameter is NULL. Further down in that form constructor are multiple references to $config['method'].

When running on PHP 7.4, this causes the following notices to appear in the logs or on the screen:

Notice: Trying to access array offset on value of type null in encrypt_config_form() (line 131 of ..snip../encrypt/includes/encrypt.admin.inc).

I'm attaching a patch I wrote to wrap these in isset(). Hope this is useful for other folks migrating to PHP 7.4.

πŸ› Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States benclark

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024