Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php |
— | — | @@ -191,10 +191,6 @@ |
192 | 192 | # shouldn't this stuff be protected? |
193 | 193 | $expressionId=$expression->id; |
194 | 194 | $languageId=$expression->languageId; |
195 | | - #$text="Copied Defined Meaning"; // this might work for now |
196 | | - # // but where to get useful |
197 | | - # // text? |
198 | | - |
199 | 195 | |
200 | 196 | $this->hackDC(); // XXX |
201 | 197 | $text=$this->getDefiningExpression(); |
— | — | @@ -212,19 +208,7 @@ |
213 | 209 | $this->getRecord() |
214 | 210 | ); |
215 | 211 | |
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; |
229 | 213 | } |
230 | 214 | |
231 | 215 | /** |
— | — | @@ -259,7 +243,7 @@ |
260 | 244 | |
261 | 245 | // Perform regular save |
262 | 246 | #$this->save(new QueryAtTransactionInformation($wgRequest->getInt('transaction'), false)); |
263 | | - $this->save(); |
| 247 | + $newDefinedMeaningId=$this->save(); |
264 | 248 | |
265 | 249 | // Update page caches |
266 | 250 | #Title::touchArray(array($wgTitle)); |
— | — | @@ -267,6 +251,7 @@ |
268 | 252 | // Add change to RC log |
269 | 253 | #$now = wfTimestampNow(); |
270 | 254 | #RecentChange::notifyEdit($now, $wgTitle, false, $wgUser, $summary, 0, $now, false, '', 0, 0, 0); |
| 255 | + return $newDefinedMeaningId; |
271 | 256 | } |
272 | 257 | |
273 | 258 | /** |
— | — | @@ -322,10 +307,20 @@ |
323 | 308 | |
324 | 309 | global |
325 | 310 | $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 | + |
326 | 318 | $wdCurrentContext=$to_dc; # set global override (DIRTY!) |
327 | | - $this->saveWithinTransaction(); |
| 319 | + $newDefinedMeaningId=$this->saveWithinTransaction(); |
| 320 | + $concept_map["$to_dc"]=$newDefinedMeaningId; |
328 | 321 | $wdCurrentContext=null; # unset override, we probably should |
329 | 322 | # use proper OO for this. |
| 323 | + |
| 324 | + createConceptMapping($concept_map); |
330 | 325 | } |
331 | 326 | |
332 | 327 | /* XXX |