Commit ac1f98a5 authored by Robert Romore's avatar Robert Romore Committed by Tessa Bakker
Browse files

Issue #3239572 by bartlangelaan, rromore, idebr: Email "" does not comply with...

Issue #3239572 by bartlangelaan, rromore, idebr: Email "" does not comply with addr-spec of RFC 2822.
parent ce70c96e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Installer\InstallerKernel;
use Drupal\Core\Logger\LoggerChannelTrait;
use Drupal\Core\Mail\MailManagerInterface;
use Drupal\Core\Messenger\MessengerTrait;
@@ -127,6 +128,14 @@ final class GuardianManager implements GuardianManagerInterface {
   * {@inheritdoc}
   */
  public function notifyModuleState($isEnabled) {
    // It is possible that guardian is installed as part of a profile installation.
    // In that case, the 'from' email is not yet available, and sending mails will fail.
    // Don't try to send mails during installation.
    // @see https://www.drupal.org/project/guardian/issues/3239572
    if (InstallerKernel::installationAttempted()) {
      return;
    }

    $site = $this->configFactory->get('system.site')->get('name');

    if ($isEnabled) {