After updating manually to Drupal 8.7.0 I get the following error when trying to create a new user or change the name of the site.

Fatal error: Declaration of Drupal\Component\Utility\EmailValidator::isValid($email, ?Egulias\EmailValidator\Validation\EmailValidation $email_validation = NULL) must be compatible with Egulias\EmailValidator\EmailValidator::isValid($email, $checkDNS = false, $strict = false) 

I imagine the problem is because I didn't updated the files correctly. Apart from that everything works fine. Is there a way to fix this?

CommentFileSizeAuthor
#7 Img.png40.87 KBrenatog

Comments

taote created an issue. See original summary.

cilefen’s picture

Category: Bug report » Support request

Could you please share with us the steps you followed to update the codebase?

aurian’s picture

Same here.
Upgrade to Drupal 8.7 done through SFTP upload of the core folder. Other folders untouched.
Multisite setup.

aurian’s picture

And after testing, I can confirm that in my case, it was caused by not updating the "vendor" directory of Drupal.

taote’s picture

Status: Active » Fixed

Yes, that's it. Updating the vendor folder fixes it. Thanks.

Status: Fixed » Closed (fixed)

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

renatog’s picture

Issue summary: View changes
StatusFileSize
new40.87 KB

@cilefen, I updated using this reference:

composer update drupal/core --with-dependencies
drush updatedb
drush cr

Do you have any recommendation/idea?

cilefen’s picture

Status: Closed (fixed) » Active

Have you compared the files in question to a clean Drupal download?

Some platforms have Zend opcache configured in a way that prevents re-reading changed classes. In that event restarting the web server may sort it out. Have you examined which files changed in the update?

teebo’s picture

I had the same issue.
composer update drupal/core
... did not do much.
I had to remove the vendor directory and rebuild it using:
composer install -vvv
That fixed the issue (make sure that your composer.json has all the requirements).

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.9 was released on November 6 and is the final full bugfix release for the Drupal 8.7.x series. Drupal 8.7.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.8.0 on December 4, 2019. (Drupal 8.8.0-beta1 is available for testing.)

Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
cilefen’s picture

Status: Active » Closed (outdated)

I am closing this support request because there have been no recent comments.

The Drupal Core issue queue is not the ideal place for support requests. Consider other sources of support.

jjmackow’s picture

I'm getting the following error when attempting to reset a password at:

Argument 1 passed to Egulias\EmailValidator\EmailValidator::isValid() must be of the type string;

I am using Drupal 9.3.2 along with Agigee Edge 2.0.1.
The full error information received on the screen is:

The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Egulias\EmailValidator\EmailValidator::isValid() must be of the type string, null given, called in /var/www/0.0.0.72-develop/web/core/lib/Drupal/Component/Utility/EmailValidator.php on line 30 in Egulias\EmailValidator\EmailValidator->isValid() (line 35 of /var/www/0.0.0.72-develop/vendor/egulias/email-validator/src/EmailValidator.php).
Egulias\EmailValidator\EmailValidator->isValid() (Line: 30)
Drupal\Component\Utility\EmailValidator->isValid() (Line: 251)
Drupal\smtp\Plugin\Mail\SMTPMailSystem->mail() (Line: 311)
Drupal\Core\Mail\MailManager->doMail() (Line: 180)
Drupal\Core\Mail\MailManager->Drupal\Core\Mail\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 181)
Drupal\Core\Mail\MailManager->mail() (Line: 1067)
_user_mail_notify() (Line: 77)
username_enumeration_prevention_pass_submit()
call_user_func_array() (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 592)
Drupal\Core\Form\FormBuilder->processForm() (Line: 320)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 708)
Drupal\Core\DrupalKernel->handle() (Line: 19)
cilefen’s picture

@jjmackow That looks like the smtp contrib module not calling the validator according to its current API, which does not accept null.

Drupal\Component\Utility\EmailValidator->isValid() (Line: 251)
Drupal\smtp\Plugin\Mail\SMTPMailSystem->mail() (Line: 311)

I suggest taking that up with that project.

cilefen’s picture

Also @jjmackow, and sorry for the noise, the thing you reported above is not the same as the one people reported in this issue.

andrii_svirin’s picture

@jjmackow did you solve your error? because I have the same error.

On password reset action happens. Drupal 9.3.2

TypeError: Argument 1 passed to Egulias\EmailValidator\EmailValidator::isValid() must be of the type string, null given, called in htdocs/web/core/lib/Drupal/Component/Utility/EmailValidator.php on line 30 in Egulias\EmailValidator\EmailValidator->isValid() (line 35 of htdocs/vendor/egulias/email-validator/src/EmailValidator.php)

#0 htdocs/web/core/lib/Drupal/Component/Utility/EmailValidator.php(30): Egulias\EmailValidator\EmailValidator->isValid()
#1 htdocs/web/core/modules/user/src/Form/UserPasswordForm.php(178): Drupal\Component\Utility\EmailValidator->isValid()
#2 [internal function]: Drupal\user\Form\UserPasswordForm->validateForm()
#3 htdocs/web/core/lib/Drupal/Core/Form/FormValidator.php(82): call_user_func_array()
#4 htdocs/web/core/lib/Drupal/Core/Form/FormValidator.php(275): Drupal\Core\Form\FormValidator->executeValidateHandlers()
#5 htdocs/web/core/lib/Drupal/Core/Form/FormValidator.php(118): Drupal\Core\Form\FormValidator->doValidateForm()
#6 htdocs/web/core/lib/Drupal/Core/Form/FormBuilder.php(588): Drupal\Core\Form\FormValidator->validateForm()
#7 htdocs/web/core/lib/Drupal/Core/Form/FormBuilder.php(320): Drupal\Core\Form\FormBuilder->processForm()
#8 htdocs/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#9 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#10 htdocs/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#11 htdocs/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#12 htdocs/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#13 htdocs/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#14 htdocs/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#15 htdocs/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#16 htdocs/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#17 htdocs/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#18 htdocs/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#19 htdocs/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#20 htdocs/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#21 htdocs/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#22 htdocs/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#23 htdocs/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle()
#24 htdocs/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#25 {main}
hardikpandya’s picture

I get this error with a password reset for Drupal 9.3.3 as well.

@parashutiki/@jjmackow were you able to fix this?

whthat’s picture

Saw this error with password reset, while we are required to use the SMTP Module but we essentially had no SMTP configuration like a null from address. Make sure your site can send an email first, then try the password reset process again.

fvictoire’s picture

Hi,

I have the same issue on Drupal 9.3.3 when I want to unlock an user.

Here are the apache logs (I have only these error logs, there's no error on admin Drupal interface, I just have a white screen).

[Mon Jul 25 13:32:41.606799 2022] [php7:error] [pid 15134] [client ...] PHP Fatal error: Declaration of Egulias\\EmailValidator\\Validation\\MessageIDValidation::isValid(string $email, Egulias\\EmailValidator\\EmailLexer $emailLexer): bool must be compatible with Egulias\\EmailValidator\\Validation\\EmailValidation::isValid($email, Egulias\\EmailValidator\\EmailLexer $emailLexer) in /var/www/html/vendor/egulias/email-validator/src/Validation/MessageIDValidation.php on line 23, referer: http://.../admin/people

I have checked that I can send an email.

Thanks.