Check for messages before removing them

Created on 28 September 2018, almost 7 years ago
Updated 9 July 2025, 23 days ago

We have a complex user registration process. We are experiencing these notices/warning:

 Notice: Undefined index: messages in user_registrationpassword_form_user_register_submit() (line 266 of /var/www/kbi.local/public_html/sites/all/modules/contrib/user_registrationpassword/user_registrationpassword.module).
    Warning: Invalid argument supplied for foreach() in user_registrationpassword_form_user_register_submit() (line 266 of /var/www/kbi.local/public_html/sites/all/modules/contrib/user_registrationpassword/user_registrationpassword.module).
    Notice: Undefined index: status in user_registrationpassword_form_user_register_submit() (line 273 of /var/www/kbi.local/public_html/sites/all/modules/contrib/user_registrationpassword/user_registrationpassword.module).
    Warning: array_values() expects parameter 1 to be array, null given in user_registrationpassword_form_user_register_submit() (line 273 of /var/www/kbi.local/public_html/sites/all/modules/contrib/user_registrationpassword/user_registrationpassword.module).

I discovered that these issues arose because of missing status messages. I've added a quick check to make sure that the message exists before we attempt to remove it.

Patch attached.

🐛 Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇨🇦Canada Ron Collins

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.71.5 2024