← Back to team overview

mahara-contributors team mailing list archive

[Bug 1468144] A change has been merged

 

Reviewed:  https://reviews.mahara.org/4838
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/8c88e64b471db10b1c896ae875896560d59a11f0
Submitter: Robert Lyon (robertl@xxxxxxxxxxxxxxx)
Branch:    master

commit 8c88e64b471db10b1c896ae875896560d59a11f0
Author: Robert Lyon <robertl@xxxxxxxxxxxxxxx>
Date:   Mon Jun 15 17:03:34 2015 +1200

Fixing the layout images being broken by locale setting

Bug 1468144

If your php site locale is one that uses comma as decimal seperator,
eg in Dutch 12,5 is the same as 12.5 in English then the layout thumbs
break.

Need to change , back to . for it to work.

The best way to do this would be to set the locale to english for the
layout creation and then set it back again but we can't be sure which
english is available so I've just done a str_replace of , to .

Change-Id: I807eda47e76d3654137681bded26164e535eb9eb
Signed-off-by: Robert Lyon <robertl@xxxxxxxxxxxxxxx>

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1468144

Title:
  Page layout thumbnails are broken if you use a locale that does commas
  for decimals

Status in Mahara ePortfolio:
  In Progress
Status in Mahara 15.04 series:
  In Progress
Status in Mahara 15.10 series:
  In Progress

Bug description:
  This bug is a follow-up to Bug 1461040. The code in Mahara that
  generates SVG files for page layouts, breaks if you are using a locale
  that does commas for decimals, instead of periods. e.g. one half is
  "0,5" rather than "0.5".

  Here's a quote from the other bug:

  I also encountered this after beginning with translation of Mahara
  15.04 into Estonian. As the locale setting have also been changed the
  values returned by PHP (please correct me if I am wrong) will be comma
  separated and not separated with decimal point (due to Estonian
  representation of float numbers). So Peter probably sees only the SVG
  images which are not returned with float values. Small output of false
  return values which are not rendered by browser: <rect x="52,2"
  y="18"..></rect>. (should be x="52.2")

  This also affects gallery where the images should be centered but due
  to false float values are not.

  The fix provided at the moment helps, but does not solve the float
  number representation. I have chosen to replace "," in returned values
  with "." in layoutpreviewimage.php and it has "solved" the problem. I
  am open for better solutions.

  I hope this helps a bit.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1468144/+subscriptions


References