Page MenuHomePhabricator

linear value in factbox and list on Property page picks a random main unit
Closed, ResolvedPublic

Description

Author: info

Description:
If a type has several conversion factors and a property doesn't override display units, then the factbox and the list of property values that displays at the end of the property page both pick a random unit as the main one. Right now ontoworld's Property:Length lists in furlongs ;-) :

California +	6,162.8 furlongs (1.31071e-10 ly, 48,818,897.588 in, 770.5 mi, 4,068,241.476 ft, 1,240 km, 1.24e+18 pm, 124,000,000 cm, 1,240,000 m)

This is a regression from 0.7 (hence high priority?). 0.7 would list values in the main unit (the first unit in [[converts to:=1 unitA, unitB, unitC]]), with the other units in parentheses.

I noticed this testing bug 11772, but I haven't figured out the code path for this. Special:Ask shows the right main unit, I'm not sure why the factbox and list of property values don't behave the same.


Version: unspecified
Severity: normal
URL: http://ontoworld.org/wiki/Property:Length

Details

Reference
bz11773

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 10:00 PM
bzimport set Reference to bz11773.

info wrote:

I think SMW_DV_Linear just populates m_unitvalues, and getLongWikiText() of a number just iterates through this, putting everything after the first item in parentheses. But there's no guarantee that the first item in the foreach of m_unitvalues will be the main unit.

I guess the factbox first shows the main unit and then calls getShortWikiText() to populate the tooltip, which skips the main unit. So perhaps getLongWikiText() should do something similar.