r23049 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23048‎ | r23049 | r23050 >
Date:16:27, 17 June 2007
Author:erik
Status:old
Tags:
Comment:
fix transaction log
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/Editor.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/Record.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/SpecialTransaction.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/SpecialTransaction.php
@@ -32,10 +32,10 @@
3333 initializeOmegaWikiAttributes(false, false);
3434 initializeAttributes();
3535
36 - $fromTransactionId = (int) $_GET['from-transaction'];
37 - $transactionCount = (int) $_GET['transaction-count'];
38 - $userName = "" . $_GET['user-name'];
39 - $showRollBackOptions = isset($_GET['show-roll-back-options']);
 36+ @$fromTransactionId = (int) $_GET['from-transaction']; # FIXME - check parameter
 37+ @$transactionCount = (int) $_GET['transaction-count']; # FIXME - check parameter
 38+ @$userName = "" . $_GET['user-name']; # FIXME - check parameter
 39+ @$showRollBackOptions = isset($_GET['show-roll-back-options']); # FIXME - check parameter
4040
4141 if (isset($_POST['roll-back'])) {
4242 $fromTransactionId = (int) $_POST['from-transaction'];
@@ -477,7 +477,7 @@
478478 $updatedAlternativeDefinitionsAttribute, $updatedAlternativeDefinitionTextAttribute,
479479 $updatedTranslatedTextPropertyAttribute;
480480
481 - $record = new ArrayRecord($updatesInTransactionAttribute->type->getStructure());
 481+ $record = new ArrayRecord($updatesInTransactionAttribute->type->getAttributes());
482482 $record->setAttributeValue($updatedDefinitionAttribute, getUpdatedDefinedMeaningDefinitionRecordSet($transactionId));
483483 $record->setAttributeValue($updatedAlternativeDefinitionsAttribute, getUpdatedAlternativeDefinitionsRecordSet($transactionId));
484484 $record->setAttributeValue($updatedAlternativeDefinitionTextAttribute, getUpdatedAlternativeDefinitionTextRecordSet($transactionId));
@@ -551,7 +551,7 @@
552552 "SELECT defined_meaning_id, translated_content_id, language_id, text_text, " .
553553 getOperationSelectColumn("{$dc}_translated_content", $transactionId) . ', ' .
554554 getIsLatestSelectColumn("{$dc}_translated_content", array('translated_content_id', 'language_id'), $transactionId) .
555 - " FROM {$dc}_defined_meaning, {$dc}_translated_content, text " .
 555+ " FROM {$dc}_defined_meaning, {$dc}_translated_content, {$dc}_text " .
556556 " WHERE {$dc}_defined_meaning.meaning_text_tcid={$dc}_translated_content.translated_content_id ".
557557 " AND {$dc}_translated_content.text_id={$dc}_text.text_id " .
558558 " AND " . getInTransactionRestriction("${dc}_translated_content", $transactionId) .
@@ -624,7 +624,7 @@
625625 "SELECT meaning_mid, translated_content_id, source_id, language_id, text_text, " .
626626 getOperationSelectColumn("{$dc}_translated_content", $transactionId) . ', ' .
627627 getIsLatestSelectColumn("{$dc}_translated_content", array('translated_content_id', 'language_id'), $transactionId) .
628 - " FROM {$dc}_alt_meaningtexts, {$dc}_translated_content, text " .
 628+ " FROM {$dc}_alt_meaningtexts, {$dc}_translated_content, {$dc}_text " .
629629 " WHERE {$dc}_alt_meaningtexts.meaning_text_tcid={$dc}_translated_content.translated_content_id ".
630630 " AND {$dc}_translated_content.text_id={$dc}_text.text_id " .
631631 " AND " . getInTransactionRestriction("{$dc}_translated_content", $transactionId) .
@@ -829,7 +829,7 @@
830830 getOperationSelectColumn("{$dc}_class_attributes", $transactionId) . ', ' .
831831 getIsLatestSelectColumn("{$dc}_class_attributes", array('object_id'), $transactionId) .
832832 " FROM {$dc}_class_attributes " .
833 - " WHERE " . getInTransactionRestriction('{$dc}_class_attributes', $transactionId)
 833+ " WHERE " . getInTransactionRestriction("{$dc}_class_attributes", $transactionId)
834834 );
835835
836836 $recordSet = new ArrayRecordSet($updatedClassAttributesStructure, new Structure($classAttributeIdAttribute));
@@ -898,7 +898,7 @@
899899 getOperationSelectColumn("{$dc}_text_attribute_values", $transactionId) . ', ' .
900900 getIsLatestSelectColumn("{$dc}_text_attribute_values", array('value_id'), $transactionId) .
901901 " FROM {$dc}_text_attribute_values " .
902 - " WHERE " . getInTransactionRestriction('{$dc}_text_attribute_values', $transactionId)
 902+ " WHERE " . getInTransactionRestriction("{$dc}_text_attribute_values", $transactionId)
903903 );
904904
905905 $recordSet = new ArrayRecordSet($updatedTextStructure, new Structure($valueIdAttribute));
@@ -967,7 +967,7 @@
968968 "SELECT value_id, object_id, attribute_mid, translated_content_id, language_id, text_text, " .
969969 getOperationSelectColumn("{$dc}_translated_content", $transactionId) . ', ' .
970970 getIsLatestSelectColumn("{$dc}_translated_content", array('translated_content_id', 'language_id'), $transactionId) .
971 - " FROM {$dc}_translated_content_attribute_values, {$dc}_translated_content, text " .
 971+ " FROM {$dc}_translated_content_attribute_values, {$dc}_translated_content, {$dc}_text " .
972972 " WHERE {$dc}_translated_content_attribute_values.value_tcid={$dc}_translated_content.translated_content_id ".
973973 " AND {$dc}_translated_content.text_id={$dc}_text.text_id " .
974974 " AND " . getInTransactionRestriction("{$dc}_translated_content", $transactionId) .
@@ -1448,7 +1448,7 @@
14491449 $dbr = &wfGetDB(DB_SLAVE);
14501450 $queryResult = $dbr->query(
14511451 "SELECT text_text " .
1452 - " FROM {$dc}_translated_content, text " .
 1452+ " FROM {$dc}_translated_content, {$dc}_text " .
14531453 " WHERE {$dc}_translated_content.translated_content_id=$translatedContentId " .
14541454 " AND {$dc}_translated_content.text_id={$dc}_text.text_id " .
14551455 " AND {$dc}_translated_content.add_transaction_id=$addTransactionId");
Index: trunk/extensions/Wikidata/OmegaWiki/Record.php
@@ -35,7 +35,8 @@
3636 }
3737
3838 public function setAttributeValue($attribute, $value) {
39 - $this->values[$attribute->id] = $value;
 39+ #FIXME: check if valid
 40+ @$this->values[$attribute->id] = $value;
4041 }
4142
4243 public function getType() {
Index: trunk/extensions/Wikidata/OmegaWiki/Editor.php
@@ -61,8 +61,10 @@
6262 }
6363
6464 public function pushAttribute($attribute) {
65 - $this->pushId($attribute->id);
66 - $this->pushClass($attribute->id);
 65+ # FIXME: check attribute id existence
 66+ @$id=$attribute->id;
 67+ $this->pushId($id);
 68+ $this->pushClass($id);
6769 }
6870
6971 public function popKey() {

Status & tagging log