Skip to content

Commit f110f00

Browse files
committed
Merge pull request #180 from tommycox/7.x-3.x-fix-division-by-zero
Added check to prevent division by zero when determining responsive grid size
2 parents 30f5ccc + de016d8 commit f110f00

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

includes/views.inc

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ function kalatheme_preprocess_views_view_grid(&$variables) {
4747
if (!$variables['options']['responsive_toggle']) {
4848
$variables['options']['columns_' . $tier] = 1;
4949
}
50-
if ($variables['gridsize'] % $variables['options']['columns_' . $tier] === 0) {
50+
if (!empty($variables['options']['columns_' . $tier]) &&
51+
$variables['gridsize'] % $variables['options']['columns_' . $tier] === 0
52+
) {
5153
$variables[$tier] = $variables['gridsize'] / $variables['options']['columns_' . $tier];
5254
}
5355
}

0 commit comments

Comments
 (0)