Little display bug with multiple column

Status
Not open for further replies.

jfquestiaux

Well-Known Member
When you set the group layout on more than 1 column, it seems that the first column is always set to "span6".

With two columns, it's alright, but starting with 3 columlns, you have: span6, span4, span4.
With 4 columns: span6, span3, span3, span3

Tested with GitHub 191.
 
I also confirm this behavior.
Using firebug and manually correct the first "span6" to "span4" (3 columns), then then layout is OK.
Printscreen attached
 

Attachments

  • 3_columns_original.png
    3_columns_original.png
    37.2 KB · Views: 344
  • 3_columns_correct.png
    3_columns_correct.png
    37.3 KB · Views: 330
Some further investigation (with the advantage of trying to undestand where things come from :p) and I got to this solution:

components\com_fabrik\models\group.php
Code:
        //$element->span = $colcount == 0 ? 'span12' : JArrayHelper::getValue($spans, $spanKey, 'span' . floor(12 / $colcount));
        $element->span = $colcount == 0 ? 'span12' : 'span' . floor(12 / $colcount);
(I replaced the original, commented, line with the second)

With some further debug I found out that, with my 3 elements in the group, $spans is always "span6" (as I didn't set any width in the group layout configuration).
$spanKey is 0,1,2 as I have 3 elements and, can't see why, "span6" is always found by "getValue" in the first case... So I removed it from the code and just let the 12/$colcount do its job.

Tested with several columns and it always worked.
Now... does this bring side effects?
 
hi thanks for that, you're fix would have meant that we ignored the group's
'Column width' option, - they bug was actually in public function columnSpans() where we were assigning '6' as the default span value even if no options entered into the 'column width' setting.
A fix is now available in github

-Rob
 
Hi Rob.

Thank you for looking into it. I updated to the latest github (217) and now, when I try to enter a group I get the following error:
An error has occurred.
500 JForm::getInstance could not load file​
Return to Control Panel

I went through post install steps and cleared the browser cache.

If I activate J! debug mode, I get the following information:
JForm::getInstance could not load file
Call stack
# Function Location
1 JAdministrator->dispatch() JROOT\administrator\index.php:56
2 JComponentHelper::renderComponent() JROOT\administrator\includes\application.php:162
3 JComponentHelper::executeComponent() JROOT\libraries\legacy\component\helper.php:339
4 require_once() JROOT\libraries\legacy\component\helper.php:359
5 JControllerLegacy->execute() JROOT\administrator\components\com_fabrik\fabrik.php:65
6 FabrikAdminController->display() JROOT\libraries\legacy\controller\legacy.php:722
7 JControllerLegacy->display() JROOT\administrator\components\com_fabrik\controller.php:40
8 FabrikAdminViewGroup->display() JROOT\libraries\legacy\controller\legacy.php:685
9 JError::raiseError() JROOT\administrator\components\com_fabrik\views\group\view.html.php:65
10 JError::raise() JROOT\libraries\legacy\error\error.php:242
 
Some further information...
If I go back to github release 208 and replace just the new "group.php", it works fine :)
And I can now set the desired widths, and it also works :)
 
I confirm this 500 error when trying to edit an existing group.
Otherwise, the display problem is solved.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top