Prevent error during install when guardian_mail set in settings.php

Created on 5 July 2023, over 1 year ago
Updated 16 October 2023, about 1 year ago

Problem/Motivation

When Guardian is enabled during Drupal installation from existing config and $settings['guardian_mail'] is already set an alert is logged because User-1 is seen as having invalid data. When using Drush this is shown as an error in the CLI.

[error] User name <em>placeholder-for-uid-1 (id:1, mail:placeholder-for-uid-1, init:@init) has a changed password or e-mail address</em>

This is not blocking other parts of the install process, so not a major issue.

The cause of this issue is that the install hook in guardian.install is called from the 'install_config_import_batch' install task before the actual email address is set during the 'install_configure_form' install task.

Steps to reproduce

- Install Drupal
- Install Guardian
- Export the configuration
- Set a value for $settings['guardian_mail']
- (Re)install Drupal using Drush with the --existing-config option

Proposed resolution

Check in GuardianManager::hasValidData() if $user->getInitialEmail() has a non-empty value.

Remaining tasks

-
- Review MR
- Merge MR

User interface changes

N/A

API changes

N/A

Data model changes

N/A

📌 Task
Status

RTBC

Version

2.0

Component

Code

Created by

🇳🇱Netherlands ricovandevin

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

Comments & Activities

Production build 0.71.5 2024