Mothership gives an error for the class killer function in the template.php on line 564:

    Warning: array_diff(): Argument #1 is not an array in mothership_class_killer() (line 566 of /var/www/html/ifdnrg_sites/www.strategic-fusion.com/newsite/sites/all/themes/mothership/mothership/template.php).
    Warning: array_values() expects parameter 1 to be array, null given in mothership_class_killer() (line 566 of /var/www/html/ifdnrg_sites/www.strategic-fusion.com/newsite/sites/all/themes/mothership/mothership/template.php).

Updated to the latest version but same issue. The code fails at this point:

/*
freeform class killing
*/
function mothership_class_killer(&$vars){
  $remove_class_node = explode(", ", theme_get_setting('mothership_classes_node_freeform'));
  $vars['classes_array'] = array_values(array_diff($vars['classes_array'],$remove_class_node));
  $vars['classes'] = "";

//  kpr($vars['classes_array']);
 // return $vars;
}

If I comment out the above, I receive no error?

Jon

Comments

bohmann’s picture

Title: Warning array_diff() error » Conflict with Theme developer
Issue tags: +devel_themer $vars['classes_array']

I received the same error after installing Theme developer, and the error disappears after uninstalling Theme Developer.

Line 566 has the $vars['classes_array'] variable that is modified by Theme Developer in a way that conflicts with Mothership:

$vars['classes_array'] = array_values(array_diff($vars['classes_array'],$remove_class_node));

Can be fixed by changing line 566 to:

$vars['classes_array'] = isset($vars['classes_array']) ? array_values(array_diff($vars['classes_array'],$remove_class_node)) : array();

Note that Theme Developer adds SPANs to the HTML that my theme doesn't like (this is of course a Theme Developer issue):

BEFORE - without Theme Developer:

<div>
<a href="/">MySite</a>
<ul class="nav">
<li><a href="/foo">Foo</a></li>
<li><a href="/bar">Bar</a></li>
</ul>
</div>

AFTER - with Theme Developer:

<div>
<a href="/">MySite</a>
<ul thmr="thmr_10" class="nav">
<li thmr="thmr_7"><a thmr="thmr_8" href="/foo">Foo</a></li>
<span class="devel-themer-wrapper" thmr="thmr_7"></span>
<li thmr="thmr_7"><a thmr="thmr_9" href="/bar">Bar</a></li>
<span class="devel-themer-wrapper" thmr="thmr_7"></span>
</ul>
</div>
mortendk’s picture

Status: Active » Closed (won't fix)

well i would say it like this : Dont use theme developer with mothership - any module that adds that amount of spans will be the mortal enemy of the ship ;)
Instead to give info about where stuff comes from ive added "the Poor Themers Helper" option (under theme dev) that will add comments all around to tell you where stuff comes from.

jjma’s picture

Thanks for the update.

Jon