Problem/Motivation

Warning: Undefined array key 1 in _unwanted_email_registration_filter_email() (line 63 of modules/contrib/unwanted_email_registration/unwanted_email_registration.module).

Steps to reproduce

Register for a new account with "example@gmail.com"

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

grasmash created an issue. See original summary.

abdulaziz zaid’s picture

What the php version and drupal?

grasmash’s picture

This happens because for some reason, _unwanted_email_registration_filter_email() is called twice. The first time $email is properly populated, the second time it is NULL.

PHP 8.2, Drupal 10.2.3.

manikandan era’s picture

StatusFileSize
new692 bytes
vensires’s picture

Status: Active » Needs review
Issue tags: +GreeceSpringSprint2024
m.managoudis’s picture

Assigned: Unassigned » m.managoudis

m.managoudis’s picture

Assigned: m.managoudis » Unassigned

Previous patch seems not fixing the problem.

The problem is that code doesn't takes into account email with NULL value (for example Anonymous user with uid == 0)

The MR below skips empty email values and continues the loop to check the rest emails:
https://git.drupalcode.org/project/unwanted_email_registration/-/merge_r...

grasmash’s picture

Title: Improper use of explode() » Do not evaluate NULL email addresses
vensires’s picture

Status: Needs review » Reviewed & tested by the community

It's a really small but working change, so if no one else has any objection, I set it as RTBC.

abdulaziz zaid’s picture

Status: Reviewed & tested by the community » Fixed

Merged.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.