Installing the module on Drupal 11.2.8 and going to the configuration page I get this error:
The website encountered an unexpected error. Try again later.
ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /var/www/html/web/modules/contrib/whatsapp/src/Form/WhatsappSettingsForm.php on line 56 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 44 of core/lib/Drupal/Core/Form/ConfigFormBase.php).
Drupal\whatsapp\Form\WhatsappSettingsForm->__construct(Object, Object, Object) (Line: 65)
Drupal\whatsapp\Form\WhatsappSettingsForm::create(Object) (Line: 36)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition('\Drupal\whatsapp\Form\WhatsappSettingsForm') (Line: 48)
Drupal\Core\Controller\HtmlFormController->getFormObject(Object, '\Drupal\whatsapp\Form\WhatsappSettingsForm') (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: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 55)
Drupal\crawler_rate_limit\CrawlerRateLimitMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->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: 53)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 715)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comments
Comment #2
mecmartini commentedProposed solution
Based on https://www.drupal.org/node/3404140:
This change is necessary for Drupal 11 compatibility. The module works fine with these modifications.
Comment #3
mecmartini commentedComment #4
joe huggansReviewed and it fixes the WhatsappSettingsForm form error. Thanks @mecmartini
Comment #5
pcambraI think this needs to be BC with D10 otherwise we'd need a new release for D11, could you please move the patch to a MR that does this in a compatible way, maybe using https://www.previousnext.com.au/blog/safely-extending-drupal-10-plugin-c...
Comment #8
albert.garcia commentedCreated a MR with the pattern suggested by @pcambra.
Comment #9
pcambraComment #11
pcambraComment #13
pcambraThanks @albert.garcia :) if you're feeling inspired, I have the same issue in the Like! module https://www.drupal.org/project/like/issues/3557853