Download & Extend

unserialize() expects parameter 1 to be string, array given in ... activitystream_feed.module in Zeile 137.

Project:Activity Stream
Version:6.x-2.0-beta2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

i got:

unserialize() expects parameter 1 to be string, array given in ... activitystream_feed.module in Zeile 137.

it was directly after an update?

Comments

#1

nobody an idea?

#2

I get the exact same error with the dev version. Upgraded form 1.0 because of the icon error and now have seen may more. Even completely uninstalled 1.0. I'm seeing no response to any of these new errors.

#3

Category:support request» bug report
Status:active» needs review

I've added

<?php
if (!is_array($params))
    {
       
$params = unserialize($params);
    }
?>

so it compensates for the fact that sometimes that $params parameter is actually and empty array.

I didn't change the $params = array() from the function parameter because some older code could still be lurking around.

#4

Status:needs review» needs work

No patch supplied so this is still needs work, not review.

You'll help more by supplying backtraces so you can detail exactly what situation makes this happen. That way the miscreant code can be fixed, rather than a workaround applied.

The offending code appears to be,

<?php
function theme_activitystream_feed_icon($params) {
 
$params = unserialize($params['data']);
  if(!empty(
$params)) {
   
//return theme('image', drupal_get_path('module', 'activitystream_feed') .'/feed-icon-16x16.png', $params['feedtitle'], $params['feedtitle']);
 
}
 
// Return the favicon if we have it. Otherwise return a default feed icon.
 
if ($params['favicon']) {
    return
'<img src="'. $params['favicon'] .'" alt="'. $params['feedtitle'] .'" height="16" width="16"/>';   
  }
  else {
   
//return theme('image', drupal_get_path('module', 'activitystream_feed') .'/feed-icon-16x16.png', $params['feedtitle'], $params['feedtitle']);
 
}
}
?>

Looks like you want to identify what code (and under what circumstances) is causing $activity->data to be an array, not a string when we're in theme('activitystream_feed_item'). At a wild guess, SimplePie might have matched multiple favicons in the relevant feed. Inspecting $activitystream->data will probably give some clues.

#5

Thanks Cool_Goose... this one worked for me. I was trying to create a block using Views to customize the number of items displayed on the front page (as opposed to the "stream" page) when I encountered the error. Strangely -- and this is a clue to my problem -- favicons coming through the activitystream.feed.module aren't rendering, while favicons through modules using the API are.