diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7485f0066b367d76b936ceab3433b5ce11bfbeca..1ca395e36d3c8dcbc6712b5311e1909c8142a372 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Views 2.x-dev o #781296 by dereine: Node: Type "link to its node" option broken. o #769010 by andrea.gariboldi: Overuse of query substitutions fails on some databases. o #607418: Fix queries broken with "ambiguous nid" due to uncommon relationships. + o #768162: Revert inadvertant change to grid style behavior. Views 2.10 (Apr 08, 2010) Bug fixes: diff --git a/plugins/views_plugin_style_grid.inc b/plugins/views_plugin_style_grid.inc index bd7277bee16e8077ef038663ee4c5a5c33183967..d04dd80d0401e2f4592ac8eb0b3d7dc5e9628a87 100644 --- a/plugins/views_plugin_style_grid.inc +++ b/plugins/views_plugin_style_grid.inc @@ -19,6 +19,7 @@ class views_plugin_style_grid extends views_plugin_style { $options['columns'] = array('default' => '4'); $options['alignment'] = array('default' => 'horizontal'); + $options['fill_single_line'] = array('default' => TRUE); return $options; } @@ -40,6 +41,13 @@ class views_plugin_style_grid extends views_plugin_style { '#default_value' => $this->options['alignment'], '#description' => t('Horizontal alignment will place items starting in the upper left and moving right. Vertical alignment will place items starting in the upper left and moving down.'), ); + + $form['fill_single_line'] = array( + '#type' => 'checkbox', + '#title' => t('Fill up single line'), + '#description' => t('If you disable this option a grid with only one row will have the amount of items as tds. If you disable it this can cause problems with your css.'), + '#default_value' => !empty($this->options['fill_single_line']), + ); } } diff --git a/theme/theme.inc b/theme/theme.inc index 429e1ea80434bc28270f937138f13b73ec424472..d2b5aacf6f8875fd5e2a04a1efc56588cd4a9fcf 100644 --- a/theme/theme.inc +++ b/theme/theme.inc @@ -430,8 +430,8 @@ function template_preprocess_views_view_grid(&$vars) { } } if ($row) { - // Fill up the last line. - if (count($rows)) { + // Fill up the last line only if it's configured, but this is default. + if (!empty($handler->options['fill_single_line']) || count($rows)) { for ($i = 0; $i < ($columns - $row_count); $i++) { $row[] = ''; }