Display Suite throwing an error? What is wrong with the world?!

warning: strlen() expects parameter 1 to be string, array given ds.module on line 775.
http://drupal.org/node/1490652

I was getting this error, which was very easy to trace back to a CCK field causing it. Just a text -> textfield is enough to cause it.

That line in DS looks like this:

<?php

 

if (isset($content) && strlen($content) > 0) {
    return
$content;
  }

?>

The $content variable for the CCK field coming through contained this (an array instead of a string):

Array ( [0] => Array ( [value] => just a test textfield [safe] =>  just a test textfield [view] =>  just a test textfield )

<

 

I fixed it by adding this above the original like 775 in ds.module, gave each item a delta div similar to standard cck/views output:

<?php

 

if(is_array($content)) {
   
$content_return = "";
    foreach(
$content as $delta => $value) {
      if (isset(
$content[$delta]['view']) && strlen($content[$delta]['view']) > 0) {
       
$content_return .= '<div class="ds-item item-'. $delta .'">' . $content[$delta]['view'] . '</div>';
      }
    }
    return
$content_return;
  }

?>

 

This just feels wrong. Display Suite is an awesome module, I use it religiously on D7, this is my first time trying to use in D6 and I find it hard to believe there is such a simple issue with it.

Joshua Walker