Problem/Motivation
When i update user i get this error:
Warning: Undefined array key "subscribe" in Drupal\mailchimp_lists\Plugin\Field\FieldWidget\MailchimpListsSelectWidget->getSubscribeFromInterests() (line 346 of /var/www/html/web/modules/contrib/mailchimp/modules/mailchimp_lists/src/Plugin/Field/FieldWidget/MailchimpListsSelectWidget.php)
#0 /var/www/html/web/core/includes/bootstrap.inc(346): _drupal_error_handler_real(2, 'Undefined array...', '/var/www/html/w...', 346)
#1 /var/www/html/web/modules/contrib/mailchimp/modules/mailchimp_lists/src/Plugin/Field/FieldWidget/MailchimpListsSelectWidget.php(346): _drupal_error_handler(2, 'Undefined array...', '/var/www/html/w...', 346)
#2 /var/www/html/web/modules/contrib/mailchimp/modules/mailchimp_lists/src/Plugin/Field/FieldWidget/MailchimpListsSelectWidget.php(330): Drupal\mailchimp_lists\Plugin\Field\FieldWidget\MailchimpListsSelectWidget->getSubscribeFromInterests(Array)
#3 /var/www/html/web/core/lib/Drupal/Core/Field/WidgetBase.php(400): Drupal\mailchimp_lists\Plugin\Field\FieldWidget\MailchimpListsSelectWidget->massageFormValues(Array, Array, Object(Drupal\Core\Form\FormState))
#4 /var/www/html/web/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php(243): Drupal\Core\Field\WidgetBase->extractFormValues(Object(Drupal\Core\Field\FieldItemList), Array, Object(Drupal\Core\Form\FormState))
#5 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityForm.php(334): Drupal\Core\Entity\Entity\EntityFormDisplay->extractFormValues(Object(Drupal\user\Entity\User), Array, Object(Drupal\Core\Form\FormState))
#6 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityForm.php(293): Drupal\Core\Entity\ContentEntityForm->copyFormValuesToEntity(Object(Drupal\user\Entity\User), Array, Object(Drupal\Core\Form\FormState))
#7 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityForm.php(155): Drupal\Core\Entity\EntityForm->buildEntity(Array, Object(Drupal\Core\Form\FormState))
#8 /var/www/html/web/core/modules/user/src/AccountForm.php(367): Drupal\Core\Entity\ContentEntityForm->buildEntity(Array, Object(Drupal\Core\Form\FormState))
#9 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityForm.php(278): Drupal\user\AccountForm->buildEntity(Array, Object(Drupal\Core\Form\FormState))
#10 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityForm.php(145): Drupal\Core\Entity\EntityForm->submitForm(Array, Object(Drupal\Core\Form\FormState))
#11 /var/www/html/web/core/modules/user/src/AccountForm.php(431): Drupal\Core\Entity\ContentEntityForm->submitForm(Array, Object(Drupal\Core\Form\FormState))
#12 [internal function]: Drupal\user\AccountForm->submitForm(Array, Object(Drupal\Core\Form\FormState))
#13 /var/www/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(114): call_user_func_array(Array, Array)
#14 /var/www/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#15 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(592): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#16 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(320): Drupal\Core\Form\FormBuilder->processForm('user_form', Array, Object(Drupal\Core\Form\FormState))
#17 /var/www/html/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\user\ProfileForm), Object(Drupal\Core\Form\FormState))
#18 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#19 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#20 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#21 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#22 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#23 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#24 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#25 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#34 {main}
Comments
Comment #2
oleh chemerys commentedI'm also experiencing the same behavior, so I have investigated the issue further and would like to provide more details below:
Problem/Motivation
When the user subscription is pending, you may experience PHP errors on some user pages.
Steps to reproduce
1. Make sure you are using PHP 8.1
2. As a user, make sure your subscription is in pending status.
3. Create a one-time login link or try recovering the password as standard.
4. Click on recovery link and enter a new password.
5. Upon password submission, you should be redirected to profile page with error message at the top.
Proposed resolution
Applying the patch to make sure there is a default unsubscribed state until user confirms subscription.
Comment #3
xenophyle commentedThanks for submitting this ticket — and sorry we didn’t get back to you about it sooner. We are cleaning up old issues and issue for old versions and are going to close this one. If this issue is still relevant for you, please re-open it and update the “Version” field, and include any updates to the behavior you are seeing.With a smaller issue queue, we’ll have an easier time getting back to you.
Comment #4
ankondrat4 commentedHello,
Issue is still relevant and I've detected it during user editing.
Comment #6
ankondrat4 commentedMoved patch from comment #2 to fork and created MR !123. Please review.
Comment #7
ankondrat4 commentedComment #10
xenophyle commentedThank you!