Closed (fixed)
Project:
Multi-column checkboxes radios
Version:
6.x-1.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Aug 2010 at 16:38 UTC
Updated:
17 Sep 2010 at 03:30 UTC
I've just tried this module for the first time on a new site we're developing and I've come across a mistake in the maths for calculating column widths in the following 2 lines -
$column_height = max($min_height, ceil(count($element['#options']) / $element['#multicolumn']['width']));
$column_width = ceil(count($element['#options']) / $column_height);
In our setup we've got 24 values that I want arranged in 7 columns (they correspond to days of the week). The first line rounds up 24/7 from 3.428... to 4. The second line then calculates the column width as 24 / 4, which is 6! Thus there's no way to get 7 columns. Surely this needs to not round up $column_height if greater than minimum, at least for calculating $colum_width.
If we do use this module, I'll try and provide a patch for this. Haven't had time to see how this variable gets used elsewhere yet.
Comments
Comment #1
mattyoung commentedGive the 'dev' version a try. It should work the way you want now. Please test in various combination of width, checkboxes/radios count, column major and row major options, try with CCK fields. I have revamped how the calculation is done inside.
Comment #2
mattyoung commented.
Comment #3
mattyoung commented~