r25536 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25535‎ | r25536 | r25537 >
Date:11:29, 5 September 2007
Author:kim
Status:old
Tags:
Comment:
Heh, only one real bug, where I checked for the existence of an
object entry table *before* actually attempting to read it.
Whoops :-P

(runs, basic testing complete)
Modified paths:
  • /trunk/extensions/Wikidata/util/copy.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/util/copy.php
@@ -107,9 +107,10 @@
108108 }
109109
110110 protected function identical() {
 111+ var_dump($this->object);
111112 $uuid=mysql_escape_string($this->object["UUID"]);
112113 $dc2=$this->dc2;
113 - return getrow($dc2,"objects", "WHERE `uuid`='$uuid'");
 114+ return getrow($dc2, "objects", "WHERE `UUID`='$uuid'");
114115 }
115116
116117 function write() {
@@ -203,10 +204,10 @@
204205 function dupSyntrans($dc1, $dc2, $olddmid, $oldexpid, $newdmid, $newexpid) {
205206 $syntrans=getOldSyntrans($dc1, $olddmid, $oldexpid);
206207 $copier=new ObjectCopier($syntrans["syntrans_sid"], "syntrans", $dc1, $dc2);
 208+ $newid=$copier->dup();
207209 if ($copier->already_there()) {
208210 return;
209211 }
210 - $newid=$copier->dup();
211212 $syntrans["syntrans_sid"]=$newid;
212213 writeSyntrans($syntrans, $newdmid, $newexpid, $dc2);
213214 }
@@ -271,8 +272,7 @@
272273
273274 function dup_translated_content($dc1, $dc2, $tcid) {
274275 $translated_content=read_translated_content($dc1, $tcid);
275 - $target_table=mysql_real_escape_string("translated_content");
276 - $copier=new ObjectCopier($tcid, $target_table, $dc1, $dc2);
 276+ $copier=new ObjectCopier($tcid, "translated_content", $dc1, $dc2);
277277 $new_tcid=$copier->dup();
278278 # note the issue where translated content is added later:
279279 # since all translated content for a single dm

Status & tagging log