Index: trunk/extensions/SemanticResultFormats/RELEASE-NOTES |
— | — | @@ -6,6 +6,8 @@ |
7 | 7 | |
8 | 8 | * Fixed error in math printer when there are no numerical results. |
9 | 9 | * Fixed vCard compatibility with SMW 1.6 and later. |
| 10 | +* Fixed array compatibility with SMW 1.6 and later. |
| 11 | +* Added median and product formats to the list of default enabled formats. |
10 | 12 | |
11 | 13 | == SRF 1.6.1 == |
12 | 14 | |
Index: trunk/extensions/SemanticResultFormats/Array/SRF_Array.php |
— | — | @@ -143,7 +143,7 @@ |
144 | 144 | $missingProperty = true; |
145 | 145 | } else |
146 | 146 | //otherwise collect property value (potentially many values) |
147 | | - foreach( $manyValues as $obj ) { // $manyValues of type SMWResultArray, contains many values (or just one) of one property of type SMWDataValue |
| 147 | + while( $obj = efSRFGetNextDV( $field ) ) { // $manyValues of type SMWResultArray, contains many values (or just one) of one property of type SMWDataValue |
148 | 148 | |
149 | 149 | $value_items = array(); |
150 | 150 | |
— | — | @@ -237,8 +237,11 @@ |
238 | 238 | |
239 | 239 | protected function createArray( $arr ) { |
240 | 240 | global $wgArrayExtension; |
241 | | - if( ! isset( $wgArrayExtension ) ) //Hash extension is not installed in this wiki |
| 241 | + |
| 242 | + if( ! isset( $wgArrayExtension ) ) { |
| 243 | + //Hash extension is not installed in this wiki |
242 | 244 | return false; |
| 245 | + } |
243 | 246 | |
244 | 247 | $arrExtClass = new ReflectionClass( get_class( $wgArrayExtension ) ); |
245 | 248 | |
— | — | @@ -247,6 +250,7 @@ |
248 | 251 | } else { |
249 | 252 | $wgArrayExtension->mArrayExtension[ $this->mArrayName ] = $arr; //dirty way |
250 | 253 | } |
| 254 | + |
251 | 255 | return true; |
252 | 256 | } |
253 | 257 | |
— | — | @@ -290,18 +294,24 @@ |
291 | 295 | } |
292 | 296 | return parent::deliverQueryResultPages( $hash ); |
293 | 297 | } |
| 298 | + |
294 | 299 | protected function createArray( $hash ) { |
295 | 300 | global $wgHashTables; |
296 | | - if( ! isset( $wgHashTables ) ) //Hash extension is not installed in this wiki |
| 301 | + |
| 302 | + if( ! isset( $wgHashTables ) ) { |
| 303 | + //Hash extension is not installed in this wiki |
297 | 304 | return false; |
298 | | - |
| 305 | + } |
| 306 | + |
299 | 307 | $hashExtClass = new ReflectionClass( get_class( $wgHashTables ) ); |
300 | 308 | |
301 | | - if( $hashExtClass->hasConstant( 'VERSION' ) && version_compare( $wgHashTables::VERSION, '0.6', '>=' ) ) { |
302 | | - $wgHashTables->createHash( $this->mArrayName, $hash ); //requires Extension:HashTables 0.6 or higher |
303 | | - } else { |
304 | | - $wgHashTables->mHashTables[ $this->mArrayName ] = $hash; //dirty way |
| 309 | + if ( $hashExtClass->hasConstant( 'VERSION' ) && version_compare( $wgHashTables::VERSION, '0.6', '>=' ) ) { |
| 310 | + $wgHashTables->createHash( $this->mArrayName, $hash ); // requires Extension:HashTables 0.6 or higher |
305 | 311 | } |
| 312 | + else { |
| 313 | + $wgHashTables->mHashTables[ $this->mArrayName ] = $hash; |
| 314 | + } |
| 315 | + |
306 | 316 | return true; |
307 | 317 | } |
308 | 318 | |