Index: trunk/extensions/Wikidata/OmegaWiki/DefinedMeaningModel.php |
— | — | @@ -91,7 +91,8 @@ |
92 | 92 | |
93 | 93 | #here we assume the DM is not there yet.. not entirely wise |
94 | 94 | #in the long run. |
95 | | - $definedMeaningId=createNewDefinedMeaning($expressionId, $langaugeId, $text); |
| 95 | + echo "id: $expressionId lang: $languageId"; |
| 96 | + $definedMeaningId=createNewDefinedMeaning($expressionId, $languageId, $text); |
96 | 97 | |
97 | 98 | getDefinedMeaningEditor($this->viewInformation)->save( |
98 | 99 | $this->getIdStack($definedMeaningId), |
— | — | @@ -117,23 +118,26 @@ |
118 | 119 | /*horrible cannibalised hack. Use at own risk*/ |
119 | 120 | /* this particular function doesn't actually work yet */ |
120 | 121 | public function saveWithinTransaction() { |
121 | | - global |
122 | | - $wgTitle, $wgUser, $wgRequest; |
| 122 | + #global |
| 123 | + # $wgTitle, $wgUser, $wgRequest; |
123 | 124 | |
124 | | - $summary = $wgRequest->getText('summary'); |
| 125 | + #$summary = $wgRequest->getText('summary'); |
125 | 126 | |
| 127 | + |
126 | 128 | // Insert transaction information into the DB |
127 | | - startNewTransaction($wgUser->getID(), wfGetIP(), $summary); |
| 129 | + #startNewTransaction($wgUser->getID(), wfGetIP(), $summary); |
| 130 | + startNewTransaction(0, "0.0.0.0", "copy operation"); |
128 | 131 | |
129 | 132 | // Perform regular save |
130 | | - $this->save(new QueryAtTransactionInformation($wgRequest->getInt('transaction'), false)); |
| 133 | + #$this->save(new QueryAtTransactionInformation($wgRequest->getInt('transaction'), false)); |
| 134 | + $this->save(); |
131 | 135 | |
132 | 136 | // Update page caches |
133 | | - Title::touchArray(array($wgTitle)); |
| 137 | + #Title::touchArray(array($wgTitle)); |
134 | 138 | |
135 | 139 | // Add change to RC log |
136 | | - $now = wfTimestampNow(); |
137 | | - RecentChange::notifyEdit($now, $wgTitle, false, $wgUser, $summary, 0, $now, false, '', 0, 0, 0); |
| 140 | + #$now = wfTimestampNow(); |
| 141 | + #RecentChange::notifyEdit($now, $wgTitle, false, $wgUser, $summary, 0, $now, false, '', 0, 0, 0); |
138 | 142 | } |
139 | 143 | |
140 | 144 | public function getRecord() { |
Index: trunk/extensions/Wikidata/OmegaWiki/SaveDM.php |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | $wdCurrentContext; |
36 | 36 | $wdCurrentContext=$dc; |
37 | 37 | #echo $model->getRecord(); |
38 | | - $model->save(); |
| 38 | + $model->saveWithinTransaction(); |
39 | 39 | } |
40 | 40 | |
41 | 41 | global |
— | — | @@ -47,7 +47,6 @@ |
48 | 48 | /* insert code here */ |
49 | 49 | |
50 | 50 | $model=getDM(663672,"uw"); |
51 | | -#saveDM($model,"tt"); |
52 | 51 | |
53 | 52 | $record=$model->getRecord(); |
54 | 53 | echo $record; |
— | — | @@ -60,6 +59,8 @@ |
61 | 60 | |
62 | 61 | echo "id: $id, spelling:$spelling, language:$language"; |
63 | 62 | |
| 63 | +saveDM($model,"tt"); |
| 64 | + |
64 | 65 | $endTime = time(); |
65 | 66 | echo("\n\nTime elapsed: " . durationToString($endTime - $beginTime)); |
66 | 67 | |