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}
CommentFileSizeAuthor
#2 3317940-1.patch931 bytesoleh chemerys

Issue fork mailchimp-3317940

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

trickfun created an issue. See original summary.

oleh chemerys’s picture

StatusFileSize
new931 bytes

I'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.

xenophyle’s picture

Status: Active » Closed (won't fix)

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

ankondrat4’s picture

Status: Closed (won't fix) » Active

Hello,

Issue is still relevant and I've detected it during user editing.

Warning: Undefined array key "subscribe" in Drupal\mailchimp_lists\Plugin\Field\FieldWidget\MailchimpListsSelectWidget->getSubscribeFromInterests() (line 433 of /var/www/html/web/modules/contrib/mailchimp/modules/mailchimp_lists/src/Plugin/Field/FieldWidget/MailchimpListsSelectWidget.php) [ef32e519-1785-4b54-9501-7729ae5eb856]
#0 /var/www/html/web/modules/contrib/mailchimp/modules/mailchimp_lists/src/Plugin/Field/FieldWidget/MailchimpListsSelectWidget.php(433): Drupal\error_page\ErrorPageErrorHandler::handleError()
#1 /var/www/html/web/modules/contrib/mailchimp/modules/mailchimp_lists/src/Plugin/Field/FieldWidget/MailchimpListsSelectWidget.php(407): Drupal\mailchimp_lists\Plugin\Field\FieldWidget\MailchimpListsSelectWidget->getSubscribeFromInterests()
#2 /var/www/html/web/core/lib/Drupal/Core/Field/WidgetBase.php(496): Drupal\mailchimp_lists\Plugin\Field\FieldWidget\MailchimpListsSelectWidget->massageFormValues()
#3 /var/www/html/web/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php(244): Drupal\Core\Field\WidgetBase->extractFormValues()
#4 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityForm.php(334): Drupal\Core\Entity\Entity\EntityFormDisplay->extractFormValues()
#5 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityForm.php(301): Drupal\Core\Entity\ContentEntityForm->copyFormValuesToEntity()
#6 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityForm.php(155): Drupal\Core\Entity\EntityForm->buildEntity()
#7 /var/www/html/web/core/modules/user/src/AccountForm.php(374): Drupal\Core\Entity\ContentEntityForm->buildEntity()
#8 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityForm.php(286): Drupal\user\AccountForm->buildEntity()
#9 /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityForm.php(145): Drupal\Core\Entity\EntityForm->submitForm()
#10 /var/www/html/web/core/modules/user/src/AccountForm.php(443): Drupal\Core\Entity\ContentEntityForm->submitForm()
#11 [internal function]: Drupal\user\AccountForm->submitForm()
#12 /var/www/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(129): call_user_func_array()
#13 /var/www/html/web/core/lib/Drupal/Core/Form/FormSubmitter.php(67): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#14 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(597): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#15 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(326): Drupal\Core\Form\FormBuilder->processForm()
#16 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): Drupal\Core\Form\FormBuilder->buildForm()

ankondrat4’s picture

Moved patch from comment #2 to fork and created MR !123. Please review.

ankondrat4’s picture

Status: Active » Needs review

  • xenophyle committed feacda24 on 2.x authored by ankondrat4
    fix: #3317940 Undefined array key "subscribe" in Drupal\mailchimp_lists\...

  • xenophyle committed 633bb88d on 3.x authored by ankondrat4
    fix: #3317940 Undefined array key "subscribe" in Drupal\mailchimp_lists\...
xenophyle’s picture

Status: Needs review » Fixed

Thank you!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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