I would like to insert some contents (e.g. Article or basic page) into my custom campaign, but I cannot to do it. At "admin/config/services/mailchimp/campaigns/add", I chose "Content" as entity type, but I couldn't choose my contents.

Do I need to do something else?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

asrob created an issue. See original summary.

asrob’s picture

Issue summary: View changes
AhmadZain’s picture

There is an Ajax error

js_-fF-p5kQxaKAsZL8HOJfpg5Z9mGxEi9QShBXGq_v-RM.js:4 POST https://{site-name}/admin/config/services/mailchimp/campaigns/add?ajax_form=1&_wrapper_format=drupal_ajax 500 (Internal Server Error)send @ js_-fF-p5kQxaKAsZL8HOJfpg5Z9mGxEi9QShBXGq_v-RM.js:4ajax @ js_-fF-p5kQxaKAsZL8HOJfpg5Z9mGxEi9QShBXGq_v-RM.js:4e.fn.ajaxSubmit @ js_-fF-p5kQxaKAsZL8HOJfpg5Z9mGxEi9QShBXGq_v-RM.js:4543Drupal.Ajax.eventResponse @ js_-fF-p5kQxaKAsZL8HOJfpg5Z9mGxEi9QShBXGq_v-RM.js:2501(anonymous function) @ js_-fF-p5kQxaKAsZL8HOJfpg5Z9mGxEi9QShBXGq_v-RM.js:2358dispatch @ js_-fF-p5kQxaKAsZL8HOJfpg5Z9mGxEi9QShBXGq_v-RM.js:3r.handle @ js_-fF-p5kQxaKAsZL8HOJfpg5Z9mGxEi9QShBXGq_v-RM.js:3
js_-fF-p5kQxaKAsZL8HOJfpg5Z9mGxEi9QShBXGq_v-RM.js:2787 Uncaught AjaxError: 
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /admin/config/services/mailchimp/campaigns/add?ajax_form=1
StatusText: Internal Server Error
ResponseText: 
AhmadZain’s picture

Priority: Normal » Major
asrob’s picture

http://cgit.drupalcode.org/mailchimp/tree/modules/mailchimp_campaign/src...

It doesn't work with entityTypeManager() but it works with entityManager() . AFAIK the latter is deprecated, so we need to fix the proper way by the first one.

amytswan’s picture

Status: Active » Fixed

Hi @asrob and @AhmadZain, thanks for catching this! I happened to see this too while working on a separate JavaScript issue, and I applied a fix for it - it's available on the latest 8.x-1.x-dev branch.

asrob’s picture

Add a patch to use it in our development.

Status: Fixed » Closed (fixed)

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

liamknuj’s picture

I am trying this patch, but I keep getting this message:

$ patch -p0 < cannot-insert-content-into-a-campaign-2772695-custom.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/modules/mailchimp_campaign/src/Form/MailchimpCampaignForm.php b/modules/mailchimp_campaign/src/Form/MailchimpCampaignForm.php
|index 616cd6f..bc5b02a 100644
|--- a/modules/mailchimp_campaign/src/Form/MailchimpCampaignForm.php
|+++ b/modules/mailchimp_campaign/src/Form/MailchimpCampaignForm.php
--------------------------
File to patch:

any suggestions ?

asrob’s picture

@liamknuj,

this issue is fixed by @amyvs in 8.x-1.x-dev.However, I added that patch because we use stable version with some patches including this one as well. By the way, we use it with composer.