Page MenuHomePhabricator

don't warn if attribute of Type:Float has a unit
Closed, ResolvedPublic

Description

Author: info

Description:
In earlier versions of SMW, you could have [[Infant mortality rate:=4.12
deaths/1,000 live births]] and if the attribute is of Type:Float, SMW would just
remember the unit in smw_attributes.value_unit.

Now, including a unit results in a warning in the factbox "this attribute
supports no unit conversion" and the help warns against it. The only way to
avoid this warning is to create a type with custom units.


Version: unspecified
Severity: normal
URL: http://ontoworld.org/wiki/Attribute:Infant_mortality_rate

Details

Reference
bz8837

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:30 PM
bzimport set Reference to bz8837.

info wrote:

The fix is just to tweak SMWFloatTypeHandler->getUnitId() in SMW_DT_Float.php to
not return smw_unexpectedunit (which is then unused).

However, maybe the warning is useful to show once in searches? The idiom of
"return (value, $errStr)" doesn't work well for returning a warning or an error.