ajax error on select INSERT SITE CONTENT

Created on 19 March 2021, over 4 years ago
Updated 10 July 2025, 16 days ago

In form "Add mailchimp campaign" (/admin/config/services/mailchimp/campaigns/add)

When I choose a option in the select in the "INSERT SITE CONTENT", I get an error in the ajax callback.

Object of class stdClass could not be converted to string in preg_replace_callback() in FilterMailchimpCampaign::process (ligne 28)

The line 28 in class Drupal\mailchimp_campaign\Plugin\Filter\FilterMailchimpCampaign :
$text = preg_replace_callback($pattern, [$this, 'processCallback'], $text);

My config
Drupal 9.1.5
php 7.4

Here the trace
Error : Object of class stdClass could not be converted to string dans preg_replace_callback() (../htdocs/modules/contrib/mailchimp/modules/mailchimp_campaign/src/Plugin/Filter/FilterMailchimpCampaign.php ligne 28)
#0 ../htdocs/modules/contrib/mailchimp/modules/mailchimp_campaign/src/Plugin/Filter/FilterMailchimpCampaign.php(28): preg_replace_callback()
#1 ../htdocs/core/modules/filter/src/Element/ProcessedText.php(118): Drupal\mailchimp_campaign\Plugin\Filter\FilterMailchimpCampaign->process()
#2 [internal function]: Drupal\filter\Element\ProcessedText::preRenderText()
#3 ../htdocs/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array()
#4 ../htdocs/core/lib/Drupal/Core/Render/Renderer.php(781): Drupal\Core\Render\Renderer->doTrustedCallback()
#5 ../htdocs/core/lib/Drupal/Core/Render/Renderer.php(372): Drupal\Core\Render\Renderer->doCallback()
#6 ../htdocs/core/lib/Drupal/Core/Render/Renderer.php(200): Drupal\Core\Render\Renderer->doRender()
#7 ../htdocs/core/lib/Drupal/Core/Render/Renderer.php(156): Drupal\Core\Render\Renderer->render()
#8 ../htdocs/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#9 ../htdocs/core/lib/Drupal/Core/Render/Renderer.php(157): Drupal\Core\Render\Renderer->executeInRenderContext()
#10 ../htdocs/core/modules/filter/filter.module(303): Drupal\Core\Render\Renderer->renderPlain()
#11 ../htdocs/modules/contrib/mailchimp/modules/mailchimp_campaign/mailchimp_campaign.module(360): check_markup()
#12 ../htdocs/modules/contrib/mailchimp/modules/mailchimp_campaign/mailchimp_campaign.module(89): mailchimp_campaign_render_template()
#13 ../htdocs/modules/contrib/mailchimp/modules/mailchimp_campaign/src/Form/MailchimpCampaignForm.php(380): mailchimp_campaign_save_campaign()
#14 [internal function]: Drupal\mailchimp_campaign\Form\MailchimpCampaignForm->validateForm()
#15 ../htdocs/core/lib/Drupal/Core/Form/FormValidator.php(82): call_user_func_array()
#16 ../htdocs/core/lib/Drupal/Core/Form/FormValidator.php(273): Drupal\Core\Form\FormValidator->executeValidateHandlers()
#17 ../htdocs/core/lib/Drupal/Core/Form/FormValidator.php(118): Drupal\Core\Form\FormValidator->doValidateForm()
#18 ../htdocs/core/lib/Drupal/Core/Form/FormBuilder.php(589): Drupal\Core\Form\FormValidator->validateForm()
#19 ../htdocs/core/lib/Drupal/Core/Form/FormBuilder.php(321): Drupal\Core\Form\FormBuilder->processForm()
#20 ../htdocs/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#21 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#22 ../htdocs/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#23 ../htdocs/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#24 ../htdocs/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#25 ../htdocs/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#26 ../htdocs/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#27 ../htdocs/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#28 ../htdocs/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle()
#29 ../htdocs/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle()
#30 ../htdocs/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#31 ../htdocs/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#32 ../htdocs/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle()
#33 ../htdocs/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#34 ../htdocs/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#35 ../htdocs/core/lib/Drupal/Core/DrupalKernel.php(706): Stack\StackedHttpKernel->handle()
#36 ../htdocs/index.php(19): Drupal\Core\DrupalKernel->handle()
#37 {main}

🐛 Bug report
Status

Closed: won't fix

Version

2.0

Component

Campaign Module

Created by

🇧🇪Belgium philalawst

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States xenophyle

    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.

Production build 0.71.5 2024