I can't make blocks appear in D7. Unlike #1265224, cache settings don't affect this issue.

Comments

tomceek’s picture

Displays error
"Warning: array_filter() [function.array-filter]: The first argument should be an array in fb_social_get_presets() (line 359 of /var/www/da-home/public_html/modules/fb_social/fb_social.module)."

denes.szabo’s picture

Problem is with the preset handling:

fb_social_get_presets($name = NULL, $enabled = TRUE, $reset = FALSE) returns back with the $name named and enabled preset settings.

But this function mixes the return type. Sometimes it gives back array sometimes preset object. If you have a $name for the preset (when you insert a block) then the $presets = fb_social_preset_load($name, $reset); returns back with the array of the preset settings.

But this code gives back FALSE because there is no $name => preset_array() just $preset_array() actually:

if (isset($name)) {                                                                                                              
    return isset($presets[$name]) ? $presets[$name] : FALSE;                                                                       
  }

If no $name given you gives back the preset or if you have a more presets then an array with preset objects.

The block uses fb_social_preset_view($preset) for displaying the block, but this function handling the $preset as object… Little bit confusing I think.

So, first we have to decide how we handling the $preset, should it's type be array or object. Then I can write a patch for this (I actually did for my site but not for the dev version of this module – quick fix was).

I think we should use the preset as object. Any idea?

tlangston’s picture

subscribing

ferdi’s picture

Status: Active » Fixed

This is fixed in the last version
thanks!

Status: Fixed » Closed (fixed)

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