I've got ddblock running successfully on my install in the Garland theme, but when I try to enable a custom theme I get the following error:

array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in /opt/local/apache2/htdocs/XXX/sites/all/themes/XXX/template.php on line 108.

this is line 108 of my template.php file:

$css[$media] = array_merge(array('framework' => array()), $css[$media]);

It is the same as you would find in this theme: http://drupal.org/project/strange_little_town

I'm going to post a request to the theme developer to look at this thread, hopefully between the two projects there's an easy answer.

I have set everything up correctly otherwise, moving the custom folder into each theme, adding the preprocess php to the template.php file, etc.

thanks!

Comments

ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

When you put the debug line

   drupal_set_message('<pre>' . var_export($vars['css'], true) . '</pre>');

In the template.php file.

What is the result?

You can comment the following two line so you don't get PHP errors

  // Make sure framework styles are placed above all others.
  //$vars['css_alt'] = css_reorder($vars['css']);
  //$vars['styles'] = drupal_get_css($vars['css_alt']);

Maybe your theme will not work but you can see the debug lines.

I don't know why this occurs only with the ddblock module enabled.

Please let me know what is the result, so I can help you further.

biscuit.tech’s picture

with the function commented out

  // Make sure framework styles are placed above all others.
  //$vars['css_alt'] = css_reorder($vars['css']);
  //$vars['styles'] = drupal_get_css($vars['css_alt']);

and

drupal_set_message('<pre>' . var_export($vars['css'], true) . '</pre>');

at the top of my template.php file,
I get NULL returned.

ppblaauw’s picture

It looks like the theme does nothing with the $vars['css'] variable if the content is NULL.

Is the ddblock module working?
You don't have an error anymore?
Does your theme work?

biscuit.tech’s picture

The theme appears to work with the function commented out and the module is also working. I'd like to know where this conflict is coming from, but I'm not sure it's worth pursuing.

Thanks for your help.

ppblaauw’s picture

Status: Postponed (maintainer needs more info) » Fixed

I think that is more for the theme maintainer to answer.
Are these functions really used with the theme or are they a copy from another theme, without any use in this theme.

I can't do anything more, so will put this to fixed, feel free to open it again.

Please let me know if you have some more information.

khanmurat’s picture

Hi, i have this problem too. my sites admin pages not running and ı dont know what i do.

ı dont know is ddblok work
i entry only frontpage, another pages not work ( only white pages).
my theme strange_little_town not work.

can you help me?

ppblaauw’s picture

Category: support » bug
Status: Fixed » Needs review

See issue http://drupal.org/node/462070#comment-1622332

Issue is caused by the ddblock module.

The issue is that the ddblock module used the $css variable to set the stylesheet for the ddblock theme. It overrides the $css variable used in the Strange Little Town template.php file.

It's not used anymore by the ddblock module.

You can delete line 1630 in the ddblock module.

  $vars['css'] = $vars['settings']['css'];

In the next release of the module will use $ddblock_[***variable_name***] to prevent this kind of issues.