Layouts column width affected by locale
Permalink
FYI, after many hours of researching this I found that the last column width % is actually calculated. The format is this: 99.99 - first column % - second column % ... All but the last column width is stored as the last column can be calculated. Problem comes when the locale is not en_US where decimal numbers separator is a comma instead of a period.
Example:
<div class="ccm-layout-1-col-3 ccm-layout-cell ccm-layout-col ccm-layout-col-3 last" style="width:36.99%"> becomes
<div class="ccm-layout-1-col-3 ccm-layout-cell ccm-layout-col ccm-layout-col-3 last" style="width:36,99%">
Effective result is that the width of the last column becomes 99% and therefore the last column breaks into the second line.
Solution (line 228 of /concrete/core/modelsélayout.php) :
if( strstr($this->breakpoints[ count($this->breakpoints)-1 ],'%') ){
//echo $cumulativeWidth;
$colWidth = number_format((99.99 - $cumulativeWidth),2);
$colWidth .= '%';
number_format disregards locale and fixes the problem.
This happened on 5.6.3.4 but I didn`t check 5.7 yet.
Example:
<div class="ccm-layout-1-col-3 ccm-layout-cell ccm-layout-col ccm-layout-col-3 last" style="width:36.99%"> becomes
<div class="ccm-layout-1-col-3 ccm-layout-cell ccm-layout-col ccm-layout-col-3 last" style="width:36,99%">
Effective result is that the width of the last column becomes 99% and therefore the last column breaks into the second line.
Solution (line 228 of /concrete/core/modelsélayout.php) :
if( strstr($this->breakpoints[ count($this->breakpoints)-1 ],'%') ){
//echo $cumulativeWidth;
$colWidth = number_format((99.99 - $cumulativeWidth),2);
$colWidth .= '%';
number_format disregards locale and fixes the problem.
This happened on 5.6.3.4 but I didn`t check 5.7 yet.