Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php |
— | — | @@ -275,7 +275,9 @@ |
276 | 276 | $options->limit = $this->limit+1; |
277 | 277 | $options->sort = true; |
278 | 278 | |
279 | | - $printrequest = new SMWPrintRequest(SMWPrintRequest::PRINT_PROP, "", $this->property); |
| 279 | + // Note: printrequests change the caption of properties they get (they expect properties to be given to them) |
| 280 | + // Since we want to continue using the property for our purposes, we give a clone to the print request. |
| 281 | + $printrequest = new SMWPrintRequest(SMWPrintRequest::PRINT_PROP, '', clone $this->property); |
280 | 282 | |
281 | 283 | $params = array(); |
282 | 284 | $params['format'] = 'ul'; |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_PrintRequest.php |
— | — | @@ -47,6 +47,7 @@ |
48 | 48 | $this->m_outputformat = 'x'; // changed default for Boolean case |
49 | 49 | } |
50 | 50 | if ($this->m_data instanceof SMWDataValue) { |
| 51 | + //$this->m_data = clone $data; // we assume that the caller denotes the object ot us; else he needs provide us with a clone |
51 | 52 | $this->m_data->setCaption($label); |
52 | 53 | } |
53 | 54 | if (NULL != $params) $m_params = $params; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Property.php |
— | — | @@ -83,6 +83,15 @@ |
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
| 87 | + * We use the internal wikipage object to store some of this objects data. |
| 88 | + * Clone it to make sure that data can be modified independelty from the |
| 89 | + * original object's content. |
| 90 | + */ |
| 91 | + public function __clone() { |
| 92 | + if ($this->m_wikipage !== NULL) $this->m_wikipage = clone $this->m_wikipage; |
| 93 | + } |
| 94 | + |
| 95 | + /** |
87 | 96 | * Extended parsing function to first check whether value refers to pre-defined |
88 | 97 | * property, resolve aliases, and set internal property id accordingly. |
89 | 98 | * @todo Accept/enforce property namespace. |
— | — | @@ -393,6 +402,13 @@ |
394 | 403 | '_CONC' => array('__con',false), |
395 | 404 | '_MDAT' => array('_dat',false), |
396 | 405 | '_ERRP' => array('_wpp',false), |
| 406 | + '_LIST' => array('__typ',true), |
| 407 | + // "virtual" properties for encoding lists in n-ary datatypes (their type must never be used, hence use __err) |
| 408 | + '_1' => array('__err',false), |
| 409 | + '_2' => array('__err',false), |
| 410 | + '_3' => array('__err',false), |
| 411 | + '_4' => array('__err',false), |
| 412 | + '_5' => array('__err',false), |
397 | 413 | ); |
398 | 414 | wfRunHooks( 'smwInitProperties' ); |
399 | 415 | } |