Skip to content

Issue #3371850: Fatal errors on account creation - restore isAnonymous check

Jeremy Skinner requested to merge issue/profile-3371850:8.x-1.x into 8.x-1.x

As mentioned in my comment on https://www.drupal.org/project/profile/issues/3371850 the previously merged fix for this issue introduces some additional issues.

Rather than checking isAuthenticated I'd recommend going back to checking isAnonymous but also check isNew as well. The problem with isAuthenticated is that other modules may have switched out the logic here.

For example, the decoupled_auth module allows the concept of users without logins (eg for CRM systems where a user record may exist for CRM purposes, but not have a login attached to it), to do this it switches out the logic of isAuthenticated.

The previously merged fix means that the decoupled_auth module no longer works with profile.

Instead, by using a combination of isAnonymous() and isNew(), you'd preserve the original behaviour without breaking modules that swap out the logic of isAuthenticated.

Merge request reports