Closed (fixed)
Project:
Mailchimp
Version:
7.x-2.0-rc1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Jun 2011 at 23:02 UTC
Updated:
25 Jul 2011 at 21:41 UTC
Warning: array_flip(): Can only flip STRING and INTEGER values! in EntityAPIController->load() (line 175 of /var/www/html/sites/all/modules/entity/includes/entity.controller.inc)
It is weird for me, but in function mailchimp_lists_cron in mailchimp_lists.module @line 96:
while ($item = $queue->claimItem() && $count < $batch_limit) {
$account = user_load($item->data['uid']);
$list = mailchimp_lists_load($item->data['list_id']);
Doesn't work, because $item equals true or fales, instead array claimItem function returns...
I changed code to this:
while ($count < $batch_limit) {
$item = $queue->claimItem();
if (!$item) {
break;
}
$account = user_load($item->data['uid']);
$list = mailchimp_lists_load($item->data['list_id']);
Basically I just moved $item = $queue->claimItem() out of while and it works perfect...
Any explanation why it is happening?
Comments
Comment #1
levelos commentedOther than potentially corrupt data, I can't. I've also tested on PHP 3 and seems fine.
Comment #2
roam2345 commentedThis go me as well, closed issues http://drupal.org/node/1207390 and http://drupal.org/node/1206926 that are duplicates of this. 'patch' worked for me!
Comment #3
roam2345 commentedReopening this as it is in fact failing for more details please view http://drupal.org/node/1207390, http://drupal.org/node/1206948 and http://drupal.org/node/1206926
Also php 5.3 on an ubuntu server if that helps. Please let me know what I can do to fast track this. If you need a more details server environment description, stack traces.. im all ears right now.
Comment #4
eusofzay commentedI want to add admin created user accounts to the list. For that I have chosen the Required list type and have also checked Sync List During Cron, but when I run cron get the following errors, repeated twenty times:
Notice: Trying to get property of non-object in mailchimp_lists_cron() (line 115 of /home/hl7org/public_html/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home/hl7org/public_html/includes/entity.inc).
Notice: Trying to get property of non-object in mailchimp_lists_cron() (line 116 of /home/hl7org/public_html/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in EntityAPIController->load() (line 175 of /home/hl7org/public_html/sites/all/modules/entity/includes/entity.controller.inc).
Notice: Trying to get property of non-object in mailchimp_lists_cron() (line 118 of /home/hl7org/public_html/sites/all/modules/mailchimp/modules/mailchimp_lists/mailchimp_lists.module).
Notice: Trying to get property of non-object in SystemQueue->deleteItem() (line 279 of /home/hl7org/public_html/modules/system/system.queue.inc).
Comment #5
roam2345 commented@eusofzay apply the patch above solves that.
Comment #6
eusofzay commentedThank you, it worked for me too.
Comment #7
he0x410 commented@eusofzay You renamed issue :)
@levelos It is not corrupted data, it is in fact, I debugged many times.
Comment #8
levelos commentedGot it, thanks for the follow up. Resolved in commit #8d45f83018e62e3d287c682924f899ffb778b268.