Tag cloud invalid font size

Bug #1836017 reported by Zvonko Martinović
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Robert Lyon

Bug Description

Font size in Tag cloud side block is not generated right. Font size is generated in lin/mahara.php, line 3985 (function get_my_tags). Code to generate tag is:
$t->size = sprintf("%0.1f", $minsize + ($maxsize - $minsize) * $weight);

Specifier f in sprintf function is local aware so in languages that use comma as decimal separator (like Croatian language) it will generate invalid value for HTML font size. Fix is simple, just use non-locale aware specifier:
$t->size = sprintf("%0.1F", $minsize + ($maxsize - $minsize) * $weight);

This will always generate decimal number with period as a decimal separator.

Changed in mahara:
status: New → Triaged
importance: Undecided → High
milestone: none → 19.10.0
importance: High → Medium
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/10313

Robert Lyon (robertl-9)
Changed in mahara:
status: Triaged → In Progress
assignee: nobody → Robert Lyon (robertl-9)
Revision history for this message
Rangi Daymond (rangid) wrote :

Hi Zvonko,

Can you please test the patch that Robert made at https://reviews.mahara.org/10313 and see if it fixes the problem for you?

Thank you
Rangi

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/10313
Committed: https://git.mahara.org/mahara/mahara/commit/ad4dd6af38bbf16206088bc66d08c443e26ebecf
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit ad4dd6af38bbf16206088bc66d08c443e26ebecf
Author: Robert Lyon <email address hidden>
Date: Mon Sep 9 08:17:45 2019 +1200

Bug 1836017: Using the non-locale aware floating-point number

To avoid languages that use comma as decimal separator (like Croatian
language)

behatnotneeded

Change-Id: I8ff67de7119bb4910750e99859d152ea960a09de
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.