Last modified: 2007-01-31 05:29:01 UTC
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.
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.