my website is running on php 5.2.0 and i have this error every time cron is running or i manualy leech data from sites.

Fatal error: Cannot use object of type stdClass as array in /***/modules/leech.module on line 321

* i removed my site path from error.

i search over net and seems that this error is from php 5. can some one help me?

Comments

alex_b’s picture

Hi slik,

The problem ocurs here:

else if ($object->leech_news_item['source_link']) {
  $list[] = $object->leech_news_item['source_link'];
}

because there is no explicit check, wether $object->leech_news_item is an array. Please try this instead:

else if (is_array($object->leech_news_item)) {
  if (isset($object->leech_news_item['source_link']) {
    $list[] = $object->leech_news_item['source_link'];
  }
}

please let me know, wether this helps.

Alex

alex_b’s picture

Slik, you sent me a private message today that the fix works. I already commit it to 4.7.x-1.x-dev. Next release version that contains the fix will be 4.7.x-1.5

Alex

alex_b’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)