Problem/Motivation

Deprecated function: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in email_registration_strip_mail_and_cleanup() (line 160 of modules/contrib/email_registration/email_registration.module).

Proposed resolution

Check if the account if anonymous, and if so, don't change the name in the email_registration_username sub-module.

Remaining tasks

Review patch and apply.

CommentFileSizeAuthor
#2 email_registraion-3505848-02.patch1004 bytesdubs
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

dubs created an issue. See original summary.

dubs’s picture

StatusFileSize
new1004 bytes

Patch to fix

ptmkenny’s picture

Status: Needs review » Needs work

Thanks for reporting this. Could you please create an MR instead of a patch so that the CI tests can be run?

shivam_tiwari made their first commit to this issue’s fork.

grevil’s picture

Thanks for finding this! Although, the current change would introduce a breaking change, as we would never enter the switch case. Currently, only the "default" case is problematic the other two are fine.

Although, I am starting to wonder where these settings are even coming from and if we really need them? There isn't even a settings page to set any of these. The code is from me, but I don't remember what this is for. I'll need to have a deeper look in a separate issue.

For now, we can temporarily move the early anonymous return inside the default case to avoid any breaking changes, in cases where someone set the "username_display_override_mode" manually via config. NW until adjusted.

grevil’s picture

grevil’s picture

Status: Needs work » Needs review

This should do the trick and prevent BC.

lrwebks’s picture

Status: Needs review » Reviewed & tested by the community

LGTM as a temporary solution, simple and effective.

grevil’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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