Broken layout blocks and my fix to it

Permalink
Yesterday I was migrating a site from one webspace to another. I had used c5 layout blocks on a lot of occasions within that site. I copied every file to a new server and restored the database. To my surprise the 2 column layout blocks didn't float anymore but were rendered underneath each other.
After carefully reviewing the source code I figured the inline styles created by c5 looked like this on the old server:
style="width: 78.99%"

but like this on the new one:
style="width: 78,99%"

The "," instead of the "." makes the CSS invalid and that is why it didn't get rendered correctly. Now, I suppose this is a database or character encoding problem. I tried many ways to come up with a solution but then decided to tackle the problem at the source.
I went to the /concrete/models/layout.php, copied it to /models/layout.php and edited line 231 from
return $colWidth;

to
return str_replace(",", ".", $colWidth);

Now, I don't know if this is the most efficient way to do it (probably not), but it solved any problem I had with it. I hope it does for you, too.

mckoenig