Problem/Motivation
Drupal Core 9.3.3
Getting this TypeError: Argument 2 passed to Drupal\smtp\Form\SMTPConfigForm::__construct() must be an instance of Drupal\Core\Messenger\Messenger, instance of Drupal\info_messages\InfoMessenger given, called in /var/www/html/websites/drupal9/beloved/web/modules/contrib/smtp/src/Form/SMTPConfigForm.php on line 86 in Drupal\smtp\Form\SMTPConfigForm->__construct() (line 67 of modules/contrib/smtp/src/Form/SMTPConfigForm.php).
Drupal\smtp\Form\SMTPConfigForm->__construct(Object, Object, Object, Object, Object, Object) (Line: 86)
Drupal\smtp\Form\SMTPConfigForm::create(Object) (Line: 28)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('Drupal\smtp\Form\SMTPConfigForm') (Line: 48)
Drupal\Core\Controller\HtmlFormController->getFormObject(Object, 'Drupal\smtp\Form\SMTPConfigForm') (Line: 58)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 19)
Drupal\sbn\Middleware\Redirect->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Steps to reproduce
Get it every time I click on SMTP authentication Support module link in config menu. Cannot change the configuration.
Proposed resolution
Don't know how this happened, but need to be able to get into config screen and modify it to correct error. I've tried uninstalling, composer remove then re-installing. Error still keeps appearing.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 3283507-messengerInterface-bug-2.patch | 6.43 KB | abdulaziz zaid |
| #5 | 3283507-messengerInterface-bug.patch | 1.59 KB | 3ssom |
| #3 | Screenshot 2022-06-28 at 1.47.00 AM.png | 275.6 KB | dipayanpramanik5 |
| #3 | Screenshot 2022-06-28 at 1.46.47 AM.png | 409.18 KB | dipayanpramanik5 |
| #3 | Screenshot 2022-06-28 at 1.46.30 AM.png | 343.25 KB | dipayanpramanik5 |
Comments
Comment #2
somebodysysop commentedComment #3
dipayanpramanik5 commentedI am not able to reproduce this issue. Running on drupal9.3.3 and module version is 1.0
based on the error message it looks like some other contributed module causing this issue in associated with any custom module
Comment #4
dipayanpramanik5 commentedComment #5
3ssom commentedThis issue has to do with our websites using Info Messages but the fix should be from in here with SMTP module because the file SMTPMailSystem.php uses Messenger instead of MessengerInterface so SMTP will throw the error when its being used.
I've fixed this issue and I'm reopening this for anyone who might come across this issue.
patch is attached.
Comment #6
3ssom commentedComment #7
abdulaziz zaidThe patch is not working #5.
Comment #8
abdulaziz zaidtry this patch its works with me.
Comment #10
japerry