r73201 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73200‎ | r73201 | r73202 >
Date:09:03, 17 September 2010
Author:daniel
Status:deferred
Tags:
Comment:
fix merge for uninitialized fields
Modified paths:
  • /trunk/extensions/DataTransclusion/MAB2RecordTransformer.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DataTransclusion/MAB2RecordTransformer.php
@@ -97,7 +97,11 @@
9898
9999 if ( !empty( $rec[ $item ] ) ) {
100100 if ( is_array( $rec[ $item ] ) ) {
101 - $r[ $field ] = array_merge( $r[ $field ], $rec[ $item ] );
 101+ if ( empty( $r[ $field ] ) ) {
 102+ $r[ $field ] = $rec[ $item ];
 103+ } else {
 104+ $r[ $field ] = array_merge( $r[ $field ], $rec[ $item ] );
 105+ }
102106 } else {
103107 $r[ $field ][] = $rec[ $item ];
104108 }

Status & tagging log