From: Tim Starling Date: Mon, 12 Apr 2004 13:44:06 +0000 (+0000) Subject: screwed head on and then fixed obvious conceptual error X-Git-Tag: 1.3.0beta1~453 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=321b7fa246defd27176d964eb16a480f3611eb57;p=lhc%2Fweb%2Fwiklou.git screwed head on and then fixed obvious conceptual error --- diff --git a/maintenance/convertLinks.php b/maintenance/convertLinks.php index 5f55541ab8..570eb0f436 100644 --- a/maintenance/convertLinks.php +++ b/maintenance/convertLinks.php @@ -47,7 +47,7 @@ if ( !wfNumRows( $res ) ) { while ( $row = wfFetchObject( $res ) ) { if ( array_key_exists( $row->l_from, $ids ) ) { - $links[$ids[$row->l_from]] = $row->l_to; + $links[$row->l_from][$row->l_to] = 1; } else { $numBad ++; } @@ -60,13 +60,15 @@ if ( !wfNumRows( $res ) ) { $sql = "INSERT INTO links_temp(l_from,l_to) VALUES "; $first = true; - foreach( $links as $from => $to ) { - if ( $first ) { - $first = false; - } else { - $sql .= ","; + foreach( $links as $from => $toArray ) { + foreach ( $toArray as $to => $one ) { + if ( $first ) { + $first = false; + } else { + $sql .= ","; + } + $sql .= "($from,$to)"; } - $sql .= "($from,$to)"; } wfQuery( $sql, DB_WRITE );