Divide by zero error on jlayout/uikit

lcollong

FabriKant d'applications web
Hi,

I've got a divide by zero error on line 32 of this file : templates/jp-exchange/html/layouts/com_fabrik/fabrik-bootstrap-grid.php part of the Fabrik-Joomla-alt-layouts uikit I've just downloaded from github.

Actually the code says :
PHP:
foreach ($d->items as $i => $s)
{
    $endLine = ($i !== 0 && (($i) % $d->columns[1] == 0));
    $newLine = ($i % $d->columns[1] == 0);

But the $d->columns array contains only one key (0, not 1) with a value of 3.
according to the line 15 : $d->columns = (array) $d->columns;
I guess the lines 32/33 should use $d->columns[0] instead of $d->columns[1] ?
 
it works indeed. But I don't understand ! ;-) Line 15 explicitly build an array and the first "foreach" is going through this array....

Also, but it may be other thing, the checkbox inside the repeated group does not care of the number of cols (see snapshots). Hence, I'm wondering how usefull is to use these jLayouts as it seems to work without ?....
 

Attachments

  • with jLayout.PNG
    with jLayout.PNG
    13.8 KB · Views: 30
  • without jLayout.PNG
    without jLayout.PNG
    10.4 KB · Views: 31
Ooops, I hadn't noticed that. Rob must have been experimenting with something. The stuff he was calculating with that code was commented out. And $d->columns is definitely just an int.

I just committed another fix.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top