I had a Mailchimp signup form as a block and a page and everything was running normally. I created a new list on mailchimp, refreshed the lists in Drupal and then created a new signup form as a block. This error comes up when I try to place the block. The signup form appears to work correctly, I can still add myself to the list, but this error shows up when the page loads. The code below was copied from my log messages. It appears to happen when I add a second signup form because I tried it with a different list and the same result happened. This error does not appear when I create a page instead of a block, a different one does but I will report that separately.

Here's the location listed in the log message: http://mysite/admin/config/services/mailchimp/signup/add?_wrapper_format=drupal_ajax&ajax_form=1&q=admin%2Fconfig%2Fservices%2Fmailchimp%2Fsignup%2Fadd&q=admin%2Fconfig%2Fservices%2Fmailchimp%2Fsignup%2Fadd

Warning: Illegal offset type in Drupal\mailchimp_signup\Form\MailchimpSignupForm->form() (line 88 of /code/modules/mailchimp/modules/mailchimp_signup/src/Form/MailchimpSignupForm.php) #0 /code/core/includes/bootstrap.inc(566): _drupal_error_handler_real(2, 'Illegal offset ...', '/code/modules/m...', 88, Array) #1 /code/modules/mailchimp/modules/mailchimp_signup/src/Form/MailchimpSignupForm.php(88): _drupal_error_handler(2, 'Illegal offset ...', '/code/modules/m...', 88, Array) #2 /code/core/lib/Drupal/Core/Entity/EntityForm.php(117): Drupal\mailchimp_signup\Form\MailchimpSignupForm->form(Array, Object(Drupal\Core\Form\FormState)) #3 [internal function]: Drupal\Core\Entity\EntityForm->buildForm(Array, Object(Drupal\Core\Form\FormState)) #4 /code/core/lib/Drupal/Core/Form/FormBuilder.php(514): call_user_func_array(Array, Array) #5 /code/core/lib/Drupal/Core/Form/FormBuilder.php(364): Drupal\Core\Form\FormBuilder->retrieveForm('mailchimp_signu...', Object(Drupal\Core\Form\FormState)) #6 /code/core/lib/Drupal/Core/Form/FormBuilder.php(621): Drupal\Core\Form\FormBuilder->rebuildForm('mailchimp_signu...', Object(Drupal\Core\Form\FormState), Array) #7 /code/core/lib/Drupal/Core/Form/FormBuilder.php(314): Drupal\Core\Form\FormBuilder->processForm('mailchimp_signu...', Array, Object(Drupal\Core\Form\FormState)) #8 /code/core/lib/Drupal/Core/Controller/FormController.php(74): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\mailchimp_signup\Form\MailchimpSignupForm), Object(Drupal\Core\Form\FormState)) #9 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) #10 /code/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #11 /code/core/lib/Drupal/Core/Render/Renderer.php(576): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #12 /code/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #13 /code/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #14 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #15 /code/vendor/symfony/http-kernel/HttpKernel.php(153): call_user_func_array(Object(Closure), Array) #16 /code/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #17 /code/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /code/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /code/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /code/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /code/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /code/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /code/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /code/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /code/core/lib/Drupal/Core/DrupalKernel.php(657): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 /code/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #27 {main}.

CommentFileSizeAuthor
#3 mailchimp-2936098-3.patch701 bytesbaikho
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rlahoda created an issue. See original summary.

baikho’s picture

Version: 8.x-1.5 » 8.x-1.x-dev
Assigned: Unassigned » baikho

Getting this warning too on latest of 8.x-1.x branch.

baikho’s picture

Assigned: baikho » Unassigned
Status: Active » Needs review
FileSize
701 bytes

This warning is logged for every Mailchimp Lists Ajax call in a Signup form instance. At some point an array is passed through as index. See added patch for an extra type check.

baikho’s picture

  • baikho authored 9f9950a on 8.x-1.x
    Issue #2936098 by baikho: Warning: Illegal offset type in Drupal\...
samuel.mortenson’s picture

Status: Needs review » Fixed

Thanks @baikho - I changed the is_int call to is_numeric in case the key is a numeric string on commit.

Status: Fixed » Closed (fixed)

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