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

Comments

SomebodySysop created an issue. See original summary.

somebodysysop’s picture

Issue summary: View changes
dipayanpramanik5’s picture

I 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

dipayanpramanik5’s picture

Status: Active » Closed (cannot reproduce)
3ssom’s picture

StatusFileSize
new1.59 KB

This 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.

3ssom’s picture

Status: Closed (cannot reproduce) » Needs review
abdulaziz zaid’s picture

Status: Needs review » Needs work

The patch is not working #5.

abdulaziz zaid’s picture

Status: Needs work » Needs review
StatusFileSize
new6.43 KB

try this patch its works with me.

  • japerry committed ce54d8e on 8.x-1.x authored by 3ssom
    Issue #3283507 by 3ssom, abdulaziz zaid: Argument 2 passed to Drupal\...
japerry’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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