I created a grid with over 100 columns and things broke. Looking at the code, I realized that it would only work when there are 10 to 99 columns / grids defined, as there was a few calls to substr($name, 4, 2) to pull out this.
The following code uses explode('-', $name) to bypass this issue.
Sorry, the CVS server is not creating a valid patch, so I'm just pasting the code in.
fusion/fusion_core/template.php
<?php
// $Id: template.php,v 1.1.2.9 2010/07/04 22:34:29 sociotech Exp $
### line 37
// Set grid info & row widths
- $grid_name = substr(theme_get_setting('theme_grid'), 0, 7);
- $grid_type = substr(theme_get_setting('theme_grid'), 7);
- $grid_width = (int)substr($grid_name, 4, 2);
+ list($grid_name, $grid_type) = explode('-', theme_get_setting('theme_grid'));
+ $grid_width = (int)substr($grid_name, 4);
+ $grid_name .= '-';
### line 243
// Initialize block region grid info once per page
if (!isset($regions)) {
- $grid_name = substr(theme_get_setting('theme_grid'), 0, 7);
- $grid_width = (int)substr($grid_name, 4, 2);
- $grid_fixed = (substr(theme_get_setting('theme_grid'), 7) != 'fluid') ? 1 : 0;
+ list($grid_name, $grid_type) = explode('-', theme_get_setting('theme_grid'));
+ $grid_width = (int)substr($grid_name, 4);
+ $grid_name .= '-';
+ $grid_fixed = ($grid_type != 'fluid') ? 1 : 0;
?>
fusion/fusion_core/theme-settings.php
<?php
// $Id: theme-settings.php,v 1.1.2.6 2010/04/08 07:02:59 sociotech Exp $
## line 127
// Generate grid type options
$grid_options = array();
if (isset($info_theme_settings['theme_grid_options'])) {
foreach ($info_theme_settings['theme_grid_options'] as $grid_option) {
$grid_type = (substr($grid_option, 7) == 'fluid') ? t('fluid grid') : t('fixed grid') . ' [' . substr($grid_option, 7) . 'px]';
$grid_options[$grid_option] = (int)substr($grid_option, 4, 2) . t(' column ') . $grid_type;
}
}
// ---- changes to
// Generate grid type options
$grid_options = array();
if (isset($info_theme_settings['theme_grid_options'])) {
foreach ($info_theme_settings['theme_grid_options'] as $grid_option) {
list($grid_name, $grid_type) = explode('-', $grid_option);
$grid_width = (int) substr($grid_name, 4);
$grid_type = ($grid_type == 'fluid') ? t('fluid grid') : t('fixed grid') . ' [' . $grid_type . 'px]';
$grid_options[$grid_option] = $grid_width . t(' column ') . $grid_type;
}
}
## line 167
// Calculate sidebar width options
- $grid_width = (int)substr($settings['theme_grid'], 4, 2);
- $grid_type = substr($settings['theme_grid'], 7);
+ list($grid_name, $grid_type) = explode('-', $settings['theme_grid']);
+ $grid_width = (int) substr($grid_name, 4);
?>
The rather large style sheet & ini file segment area attached for testing, but creating a 2 or 3 grid array will also break the logic in the code.
Cheers
Alan
Comments
Comment #1
alan d. commentedPS: I'm totally new to the project, so this needs so experienced eyes on it.
I've created a patch against the themes folder in the project using SVN to show the above modifications better, but this can not be applied to the checked out theme from Drupal CVS.
Comment #2
alan d. commentedBumping to critical as this seems to have been ignored and with grids <10 & >99, the entire theme is unusable.
Comment #3
jeremycaldwell commentedComment #4
stephthegeek commentedComment #5
aquariumtap commentedComment #7
Poieo commentedClosing as won't fix since the D6 version is getting no new development.
Comment #8
alan d. commentedWithout using Fusion since this particular site (2010), doesn't this code (from 7.x-2.x branch) do the same thing?
Comment #9
Poieo commentedChanging to a possible issue for the 7.x-2.x branch, however it is not critical.
Thanks for taking the time to look into this again.
Comment #10
Poieo commentedMarked #1320418: _fusion_skins_grid_options() does not make correct classes for custom grids with less than 10 columns as a duplicate of this issue.
Comment #11
Poieo commentedPostponing this to the 7.x-3.x version.