Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_QueryResult.php |
— | — | @@ -268,13 +268,13 @@ |
269 | 269 | case SMWPrintRequest::PRINT_PROP: |
270 | 270 | $this->m_content = $this->m_store->getPropertyValues($this->m_result,$this->m_printrequest->getData(), $this->getRequestOptions(), $this->m_printrequest->getOutputFormat()); |
271 | 271 | // Print one component of a multi-valued string. |
272 | | - // Known limitation: the printrequest still is of type __nry, so if printers check |
| 272 | + // Known limitation: the printrequest still is of type _lst, so if printers check |
273 | 273 | // for this then they will not recognize that it returns some more concrete type |
274 | | - if (($this->m_printrequest->getTypeID() == '__nry') && ($this->m_printrequest->getParameter('index') !== false)) { |
| 274 | + if (($this->m_printrequest->getTypeID() == '_lst') && ($this->m_printrequest->getParameter('index') !== false)) { |
275 | 275 | $pos = $this->m_printrequest->getParameter('index')-1; |
276 | 276 | $newcontent = array(); |
277 | | - foreach ($this->m_content as $naryval) { |
278 | | - $dvs = $naryval->getDVs(); |
| 277 | + foreach ($this->m_content as $listdv) { |
| 278 | + $dvs = $listdv->getDVs(); |
279 | 279 | if ( (array_key_exists($pos,$dvs)) && ($dvs[$pos] !== NULL) ) { |
280 | 280 | $newcontent[] = $dvs[$pos]; |
281 | 281 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Property.php |
— | — | @@ -289,7 +289,7 @@ |
290 | 290 | $result = SMWDataValueFactory::newTypeIDValue('__typ'); |
291 | 291 | if (array_key_exists($this->m_propertyid, SMWPropertyValue::$m_propertytypes)) { |
292 | 292 | $result->setDBkeys(array(SMWPropertyValue::$m_propertytypes[$this->m_propertyid][0])); |
293 | | - } else { // fixed default for special properties |
| 293 | + } else { // fixed default type (should rarely matter) |
294 | 294 | $result->setDBkeys(array('_str')); |
295 | 295 | } |
296 | 296 | } |
— | — | @@ -298,14 +298,14 @@ |
299 | 299 | } |
300 | 300 | |
301 | 301 | /** |
302 | | - * Quickly get the type id of some property without necessarily making another datavalue. |
303 | | - * Note that this is not the same as getTypeID(), which returns the id of this property |
304 | | - * datavalue. |
| 302 | + * Quickly get the type id of some property without necessarily making |
| 303 | + * another datavalue. Note that this is not the same as getTypeID(), which |
| 304 | + * returns the id of this property datavalue. |
305 | 305 | */ |
306 | 306 | public function getPropertyTypeID() { |
307 | 307 | if ($this->prop_typeid === NULL) { |
308 | 308 | $type = $this->getTypesValue(); |
309 | | - $this->prop_typeid = $type->isUnary()?$type->getDBkey():'__nry'; |
| 309 | + $this->prop_typeid = $type->getDBkey(); |
310 | 310 | } |
311 | 311 | return $this->prop_typeid; |
312 | 312 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Types.php |
— | — | @@ -13,6 +13,8 @@ |
14 | 14 | * wiki values, in order to support speedy creation of datavalues in |
15 | 15 | * SMWDataValueFactory. |
16 | 16 | * |
| 17 | + * @todo This class has an own stubbing mechanism that is older than the |
| 18 | + * current one used in SMWDataValue. It is confusing to have two. |
17 | 19 | * @author Markus Krötzsch |
18 | 20 | * @ingroup SMWDataValues |
19 | 21 | */ |
— | — | @@ -190,10 +192,9 @@ |
191 | 193 | /** |
192 | 194 | * Convenience method to obtain the (single) DB key as a string (not in an array). |
193 | 195 | * Provided since many callers can use this hash for type recognition and registry. |
194 | | - * |
195 | 196 | */ |
196 | 197 | public function getDBkey() { |
197 | | - if ($this->m_xsdvalue === false) { |
| 198 | + if ( $this->isvalid() && ($this->m_xsdvalue === false) ) { |
198 | 199 | $first = true; |
199 | 200 | $this->m_xsdvalue = ''; |
200 | 201 | foreach ($this->m_typelabels as $label) { |