In my Drupal log, I get the error:

array_slice() [function.array-slice]: The first argument should be an array in /
/modules/directory/directory.module on line 472.

Comments

nschindler’s picture

Just realized that this only happens on the main directory page (index.php?q=directory).

I think I may have fixed this problem and accidentally fixed another with the following patch

--- directory.module.orig       2007-08-10 13:38:18.000000000 -0700
+++ directory.module    2007-08-10 13:38:50.000000000 -0700
@@ -465,6 +465,7 @@
            . $nodecount_span . '</span>';
       }
     }
+if ($items) {
     $col[] = array_slice($items, 0, $split);
     $col[] = array_slice($items, $split);
     $header = array(array('data' => t('By <em>%vocabulary-name</em>', array('%vocabulary-name' => $vocabulary->name)), 'colspan' => count($col)));
@@ -474,7 +475,7 @@
     }
     $row[] = $r;
     $output .= theme('table', $header, $row, array('class' => 'directory-resources'));
-
+       }

   }
   else { //General category listing

It basically just puts some of the code within an if statement so that it doesn't run if there are no node items to display. no more error in the log.
The other thing this appears to fix is, if you have the "Hide terms with no content" option enabled, you would still see empty top-level vocabularies. They hide properly with the above change.

beginner’s picture

Version: 4.7.x-2.1 » 6.x-1.0-alpha1
Status: Active » Fixed

The D6 version no longer uses array_slice().
4.7 and 5 are unsupported.

See the new D6 alpha release announcement:
http://drupal.org/node/283259

Anonymous’s picture

Status: Fixed » Closed (fixed)

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