Hello All,

My code that sends periodic emails through Mailchimp using this module died last week. I've been trying to troubleshoot this today.

This line;

$campaign_id = mailchimp_campaign_save_campaign($template_content, $options);

Creates PDO Exceptions via the entity_modified module because the entity_id used is not an integer;

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'ffabd27f3c' for column 'entity_id' at row 1: INSERT INTO {entity_modified} (entity_type, entity_id, modified) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array
(
    [:db_insert_placeholder_0] => mailchimp_campaign
    [:db_insert_placeholder_1] => ffabd27f3c
    [:db_insert_placeholder_2] => 1449468150
)

As you can see, 'ffabd27f3c' is not a valid entity_id as it contains both alphanumeric chars.

Now, I've gotten around this for the time being by changing the entity_id col to a varchar(20) (from int(10)) but thats an ugly 'fix'.

Any ideas?

Thanks,

Christian

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cbiggins created an issue. See original summary.

Anonymous’s picture

Status: Active » Needs review
FileSize
9.6 KB

Hi, I had the same problem. I wrote this patch for it. There are more issues having the entity id as string. The hash for the campaign id is still available though.

mnlund’s picture

Hi,

I have created a new patch for this problem just adding the property modified property name to the entity info hook to support the Entity modified module.

ruscoe’s picture

Status: Needs review » Closed (won't fix)

We're going to be ending support for the 7.x-3.x branch due to the upcoming deprecation of the v2.0 MailChimp API. If you'd still like to make this change, please feel free to reopen for the 7.x-4.x branch (patch will also need to be rerolled.)

mcrump’s picture

Hello all,

I have rerolled the original patch against 7.x-4.x-dev and reopened this issue. The latest version of the patch file is attached. Hope it helps.

Cheers,

Michael

ruscoe’s picture

Status: Needs review » Needs work

Thanks for rerolling the patch! Unfortunately the patch is removing most of the parameters from the mailchimp_campaign_list_templates() function. I know of one site in production that's using those parameters and there are probably more out there.

Could you update the patch so doesn't remove those parameters?

johndubo’s picture

mcrump and ruscoe,

Just curious if there is any update on this. I'm having the exact same problem, but I need to keep Entity Modified b/c it is required by DFP module. Thanks for all the work on this!

johndubo’s picture

mnlund's campaign-support-entity-modified.patch in comment #3 worked for me in 7.x-4.8

Any reason why this might cause problems?

Thanks.

brunodbo’s picture

Also running into this because of a contrib module's dependency on entity_modified.

Attached patch is a variation on #6:

- I removed the changes to mailchimp_campaign_list_templates(): could be I'm missing something, but they seem to be related to a different issue?
- A added the newly added entity id to the entity_create call in mailchimp_campaign_save_campaign() - without it, updating an existing campaign entity causes an integrity constraint violation error.

brunodbo’s picture

Status: Needs work » Needs review
efpapado’s picture

Attaching an enhancement of patch #11, to be compatible with the (already committed) patch of this issue: https://www.drupal.org/node/2836141

ytsurk’s picture

Issue tags: +needs Drupal 8 port

This issue still remains in D8.

fe. when using the entity reference field, the entity_usage table is not compatible .. and a WSOD is happening ..

ytsurk’s picture