r25029 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25028‎ | r25029 | r25030 >
Date:03:01, 22 August 2007
Author:kim
Status:old
Tags:
Comment:
refactored one of the hacks back out. (blame me for working so early)
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php
@@ -191,10 +191,6 @@
192192 # shouldn't this stuff be protected?
193193 $expressionId=$expression->id;
194194 $languageId=$expression->languageId;
195 - #$text="Copied Defined Meaning"; // this might work for now
196 - # // but where to get useful
197 - # // text?
198 -
199195
200196 $this->hackDC(); // XXX
201197 $text=$this->getDefiningExpression();
@@ -212,19 +208,7 @@
213209 $this->getRecord()
214210 );
215211
216 - /* And do some conceptmapping.
217 - * Not as painful as you might think:
218 - * createConceptMapping is already dataset agnostic
219 - * XXX Still, I'm pulling datasets back out of (un)hackDC...
220 - */
221 - $map=array();
222 - $this->hackDC(); # XXX
223 - $dataset1=$this->getDataSet();
224 - $oldId=$this->getId();
225 - $map["$dataset1"]=$oldId;
226 - $dataset2=$this->unhackDC(); # XXX
227 - $map["$dataset2"]=$newDefinedMeaningId;
228 - createConceptMapping($map);
 212+ return $newDefinedMeaningId;
229213 }
230214
231215 /**
@@ -259,7 +243,7 @@
260244
261245 // Perform regular save
262246 #$this->save(new QueryAtTransactionInformation($wgRequest->getInt('transaction'), false));
263 - $this->save();
 247+ $newDefinedMeaningId=$this->save();
264248
265249 // Update page caches
266250 #Title::touchArray(array($wgTitle));
@@ -267,6 +251,7 @@
268252 // Add change to RC log
269253 #$now = wfTimestampNow();
270254 #RecentChange::notifyEdit($now, $wgTitle, false, $wgUser, $summary, 0, $now, false, '', 0, 0, 0);
 255+ return $newDefinedMeaningId;
271256 }
272257
273258 /**
@@ -322,10 +307,20 @@
323308
324309 global
325310 $wdCurrentContext;
 311+
 312+ $concept_map=array(); # while we're here, let's map the concepts.
 313+
 314+ $from_dc=$this->getDataSet();
 315+ $oldId=$this->getId();
 316+ $concept_map["$from_dc"]=$oldId;
 317+
326318 $wdCurrentContext=$to_dc; # set global override (DIRTY!)
327 - $this->saveWithinTransaction();
 319+ $newDefinedMeaningId=$this->saveWithinTransaction();
 320+ $concept_map["$to_dc"]=$newDefinedMeaningId;
328321 $wdCurrentContext=null; # unset override, we probably should
329322 # use proper OO for this.
 323+
 324+ createConceptMapping($concept_map);
330325 }
331326
332327 /* XXX

Status & tagging log