Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php |
— | — | @@ -345,9 +345,12 @@ |
346 | 346 | abstract protected function parseUserValue( $value ); |
347 | 347 | |
348 | 348 | /** |
349 | | - * Initialise the datavalue from the given value string and unit. |
350 | | - * The format of both strings strictly corresponds to the output |
351 | | - * of this implementation for getDBkeys(). |
| 349 | + * Initialise the datavalue from the given value array. |
| 350 | + * The format of this array corresponds to the output of |
| 351 | + * getDBkeys() but the method might be called with shorter |
| 352 | + * arrays (e.g. if typing information changed since a value |
| 353 | + * was stored). However, there will always be at least one |
| 354 | + * element in the array. |
352 | 355 | * |
353 | 356 | * @param array $args |
354 | 357 | */ |
— | — | @@ -440,7 +443,6 @@ |
441 | 444 | * - l for arbitrarily long strings; searching/sorting with such data may |
442 | 445 | * be limited for performance reasons, |
443 | 446 | * - w for strings as used in MediaWiki for encoding interwiki prefixes |
444 | | - * - u for short ("unit") strings; used for units of measurement in SMW |
445 | 447 | * - n for namespace numbers (or other similar integers) |
446 | 448 | * - f for floating point numbers of double precision |
447 | 449 | * - c for the special container format used by SMWContainerValue; if used |
— | — | @@ -621,7 +623,6 @@ |
622 | 624 | * FALSE if no such version is available. The returned |
623 | 625 | * string suffices to reobtain the same DataValue |
624 | 626 | * when passing it as an input string to setUserValue(). |
625 | | - * Thus it also includes units, if any. |
626 | 627 | */ |
627 | 628 | abstract public function getWikiValue(); |
628 | 629 | |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -122,8 +122,8 @@ |
123 | 123 | '_wpp' => array( 'tnwt', 3, 3 ), // Property page type |
124 | 124 | '_wpc' => array( 'tnwt', 3, 3 ), // Category page type |
125 | 125 | '_wpf' => array( 'tnwt', 3, 3 ), // Form page type (for Semantic Forms) |
126 | | - '_num' => array( 'tfu', 1, 0 ), // Number type |
127 | | - '_tem' => array( 'tfu', 1, 0 ), // Temperature type |
| 126 | + '_num' => array( 'tf', 1, 0 ), // Number type |
| 127 | + '_tem' => array( 'tf', 1, 0 ), // Temperature type |
128 | 128 | '_dat' => array( 'tf', 1, 0 ), // Time type |
129 | 129 | '_boo' => array( 't', 0, 0 ), // Boolean type |
130 | 130 | '_rec' => array( 'tnwt', 0, -1 ),// Value list type (internal object) |
— | — | @@ -137,7 +137,7 @@ |
138 | 138 | '__spf' => array( 't', 0, 0 ), // Special form type (for Semantic Forms) |
139 | 139 | '__sin' => array( 'tnwt', 3, 3 ), // Special instance of type |
140 | 140 | '__red' => array( 'tnwt', 3, 3 ), // Special redirect type |
141 | | - '__lin' => array( 'tfu', 1, 0 ), // Special linear unit conversion type |
| 141 | + '__lin' => array( 'tf', 1, 0 ), // Special linear unit conversion type |
142 | 142 | '__imp' => array( 't', 0, 0 ), // Special import vocabulary type |
143 | 143 | '__pro' => array( 't', 0, 0 ), // Property page type; never be stored as a value (_wpp is used there) but needed for sorting |
144 | 144 | '' => array( 'tlnnn', 0, 0 ) |
— | — | @@ -1262,7 +1262,6 @@ |
1263 | 1263 | // Repeatedly used DB field types defined here for convenience. |
1264 | 1264 | $dbtypes = array( |
1265 | 1265 | 't' => SMWSQLHelpers::getStandardDBType( 'title' ), |
1266 | | - 'u' => ( $wgDBtype == 'postgres' ? 'TEXT' : 'VARCHAR(63) binary' ), |
1267 | 1266 | 'l' => SMWSQLHelpers::getStandardDBType( 'blob' ), |
1268 | 1267 | 'f' => ( $wgDBtype == 'postgres' ? 'DOUBLE PRECISION' : 'DOUBLE' ), |
1269 | 1268 | 'i' => ( $wgDBtype == 'postgres' ? 'INTEGER' : 'INT(8)' ), |
— | — | @@ -1749,7 +1748,7 @@ |
1750 | 1749 | |
1751 | 1750 | if ( $ok ) { |
1752 | 1751 | $result[$i] = $item; |
1753 | | - $sortres[$i] = $value; // we cannot use $value as key: it is not unique if there are units! |
| 1752 | + $sortres[$i] = $value; |
1754 | 1753 | $i++; |
1755 | 1754 | } |
1756 | 1755 | } |
— | — | @@ -2473,7 +2472,7 @@ |
2474 | 2473 | |
2475 | 2474 | self::$prop_tables['smw_atts2'] = new SMWSQLStore2Table( |
2476 | 2475 | 'smw_atts2', |
2477 | | - array( 'value_xsd' => 't', 'value_num' => 'f', 'value_unit' => 'u' ), |
| 2476 | + array( 'value_xsd' => 't', 'value_num' => 'f' ), |
2478 | 2477 | array( 'value_num', 'value_xsd' ) |
2479 | 2478 | ); |
2480 | 2479 | |