Index: theme/theme.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views/theme/theme.inc,v retrieving revision 1.73.2.5 diff -u -p -r1.73.2.5 theme.inc --- theme/theme.inc 1 Jul 2009 22:52:42 -0000 1.73.2.5 +++ theme/theme.inc 4 Sep 2009 10:07:10 -0000 @@ -394,14 +394,21 @@ function template_preprocess_views_view_ if ($options['alignment'] == 'horizontal') { $row = array(); + $row_count = 0; foreach ($vars['rows'] as $count => $item) { $row[] = $item; + $row_count ++; if (($count + 1) % $columns == 0) { $rows[] = $row; $row = array(); + $row_count = 0; } } if ($row) { + // Fill up the last line. + for ($i = 0; $i < ($columns - $row_count); $i++) { + $row[] = ''; + } $rows[] = $row; } } @@ -425,6 +432,12 @@ function template_preprocess_views_view_ $remainders--; } } + for ($i = 0; $i < count($rows[0]); $i++) { + // This should be string so that's okay :) + if (!isset($rows[count($rows) - 1][$i])) { + $rows[count($rows) - 1][$i] = ''; + } + } } $vars['rows'] = $rows; }